In order to add item in to cache we can use method "InsertCacheItem". Can you please let us know the syntax to use this method.
Also we didn't find method to fetch items from the cache. There are methods like "GetCacheItem" available but these are marked as Obselete. Should we continue to use to use this method or there are some other methods to fetch data from the cache.
Cache in Umbraco
Hi All,
We had a look at the Umbraco and find that we can access cache by using following class
ApplicationContext.Current.ApplicationCache.RuntimeCache
In order to add item in to cache we can use method "InsertCacheItem". Can you please let us know the syntax to use this method.
Also we didn't find method to fetch items from the cache. There are methods like "GetCacheItem" available but these are marked as Obselete. Should we continue to use to use this method or there are some other methods to fetch data from the cache.
I would recommend you use the below extension method in
Umbraco.Cache.Core
which will do both the get and the insert (if needed)For example
As a matter of interest, what is the first
()
doing in this part of the code above?Jules
is working on a reply...