Caching object EPiServer is easier then you probably think
It very often I see EPiServer sites using the CacheManager.RuntimeCache or ASP.NET runtime cache to store “hard to get objects” in - this will not update cached objects on remote site on a web farm.
To get the remote events to update caches on all machine a recommend to use EPiServer.CacheManagers static methods
// To add a cached object on the local machine
EPiServer.CacheManagers.Add(…)
// To get a local stored cache object
EPiServer.CacheManagers.Get(…)
// To remove a cache object on all machines on the web farm
EPiServer.CacheManagers.Remove(…)
And NEVER use the methods starting with RuntimeCache… (if you are not absolutely sure that you want to use the local cache)
Comments