Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am building a SharePoint sandbox solution which consists of multiple web parts. I want to be able to somehow cache POCO objects (Plain Old CLR Objects) in such a way that the cache is persisted across full page requests and the cache works in SharePoint online as well.

I have looked at the following mechanisms:

  • Saving files on the file system or in Isolated Storage - doesn't work because the System.IO namespace seems to be blocked in sandbox solutions.
  • Using the ASP.NET Cache/Session/Application infrastructure - doesn't work, the cache is reset every time a new page request is made.
  • Using the Microsoft.Office.Server.ObjectCache.SPCache infrastructure - doesn't seem to work, the cache is reset in the same way as with ASP.NET cache.
  • using a handcoded in-memory cache: (private static Dictionary<string, object> ...) - doesn't work, the dictionary instance is lost across http page requests.

Does all of the above mean that my only option of storing any kind of data in SharePoint sandbox solutions is to use Sharepoint lists/list-items?

share|improve this question
add comment

2 Answers 2

up vote 4 down vote accepted

Yes, SharePoint lists are your only option in this case.

Each request is marshalled from ASP.NET/SharePoint to a specific Sandbox process. These processes and AppDomains are not guaranteed to be the same or even on the same machine, so any kind of in-memory cache is out of question.

share|improve this answer
add comment

Instead of creating webparts, you could create Silverlight apps that do not generate a Postback.

Then again, Silverlight apps are limited due to the Client Side Object Model.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.