[英]How to Cache Sharepoint Managed Client Object Model based objects?
I need to Cache certain objects which are based on SharePoint Managed Client Object Model like ClientContext, GroupCollection, User , List etc. Initially I tried using Appfabric cache but it gives some issues like "cannot be serialized" . 我需要缓存某些基于SharePoint管理客户端对象模型的对象,如ClientContext,GroupCollection,User,List等。最初我尝试使用Appfabric缓存,但它提出了一些问题,如“无法序列化”。 Here my question is " Is it possible to serialize SharePoint Managed Client Object Model based Objects? " .
在这里,我的问题是“ 是否可以序列化基于SharePoint托管客户端对象模型的对象? ”。
Next I tried with .NET ObjectCache which actually caches the SP's Managed Client Objects but problem over here is I need a distributed / unified caching technique. 接下来我尝试使用.NET ObjectCache实际缓存SP的托管客户端对象,但问题是我需要一种分布式/统一缓存技术。 As per my knowledge we cant make ObjectCache distributed over multiple hosting servers.
据我所知,我们不能让ObjectCache分布在多个托管服务器上。 Can anyone suggest me a solution or show me light to proceed.
任何人都可以建议我一个解决方案或让我明白继续。 Thanks in advance.
提前致谢。
SharePoint Client Object Model will not support Object Cache wrt the Client objects. SharePoint客户端对象模型将不支持客户端对象的对象缓存。 That is the limitation in Client Object Model.
这是客户端对象模型的限制。
You cannot serialize the context or the result of a query. 您无法序列化上下文或查询结果。 Also a
ListItem
cannot be serialized. ListItem
也无法序列化。 Nonetheless: At least when thinking about query-results the most important information you usually want to know is the content of the fields returned. 尽管如此:至少在考虑查询结果时,您通常想知道的最重要信息是返回字段的内容。 So,
ListItem.FieldValues
is a simple Dictionary<string,object>
which can be easily serialized. 因此,
ListItem.FieldValues
是一个简单的Dictionary<string,object>
,可以很容易地序列化。
You could use this Dictionary in combination with the Listitem's ID to create your own caching mechanism. 您可以将此Dictionary与Listitem的ID结合使用来创建自己的缓存机制。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.