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?