cachingsitecoresitecore8sitecore-mvc

Sitecore custom cache is not shared across all CD servers


I have implemented a Sitecore custom cache which works fine on my local instance. I have pushed changes to production (in production we have 5 CD servers which are served through a load balancer). When the first request is made the code fetches some data from DB and cache it. If the same request goes to other CD box the previously fetched data is not available in the cache!

Can someone help on this? Do CD servers not share the cache across?


Solution

  • This is the expected behaviour of the in-memory cache what works well for single-server deployments only like your local instance, but when you have multiple CDs each of them has its own local memory cache store not shared with others.

    Therefore, for scaled deployments, you can use the Redis Cache as a centralised cache store, so that each CD role can access that cache store and retrieve the cached data.

    Redis Cache is verified by time and works well when synchronising data updates between multiple CDs.