Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I would like to store a small number of text strings in the runtime cache
using Umbraco.Core.CacheHelper
ie
ApplicationContext.Current.ApplicationCache.Runtime
but after searching, I am not 100% clear on how to get and to set values - can anyone supply an example.
I think I can use get to also set values but how would I update them once set?
I have tried
ApplicationContext.ApplicationCache.RuntimeCache.InsertCacheItem
where I have created a class myObject and and instance rC but this crashes
Compiler Error Message: CS0120: An object reference is required for the non-static field, method, or property 'Umbraco.Core.ApplicationContext.ApplicationCache.get'
I believe you need to work with an instance of the cache.
var cache = ApplicationContext.Current.ApplicationCache.RuntimeCache; cache.GetCacheItem("rssFeed") cache.InsertCacheItem("rssFeed", ()=> { return nodeList; }, timeout: TimeSpan.FromDays(2));
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Using ApplicationContext.Current.ApplicationCache.Runtime
I would like to store a small number of text strings in the runtime cache
ie
but after searching, I am not 100% clear on how to get and to set values - can anyone supply an example.
I think I can use get to also set values but how would I update them once set?
I have tried
ApplicationContext.ApplicationCache.RuntimeCache.InsertCacheItem
where I have created a class myObject and and instance rC but this crashes
I believe you need to work with an instance of the cache.
is working on a reply...