We are interested in using a distributed cache (Redis) for our Xperience 13 MVC site.
The site will be hosted in a web farm on Azure (geo-replicated) so in-memory caching is not an optimal solution.
We like the Kentico API and the integration with IPageCacheBuilder because of the ability to invalidate the cache when a dependency is changed on the admin site.
We would like to leverage the IPageCacheBuilder in a way that the cached pages will be saved directly on Redis rather than in memory.
In other words, we want the following code to cache the result in Redis:
query => query
cache => cache
.Dependencies((_, builder) => builder.PagePath(nodeAliasPath, PathTypeEnum.Children)));
Is that possible at all? What's the best way to have the result cached in a distributed cache without haveing to manage 2 sets of cache: in-memory and distributed?
The IPageRetriever uses IProgressiveCache internally to do caching.
You can re-implement this type and override Xperience's DI registration with your 'Redis' implementation of the CMS.Helpers.IProgressive cache interface.
Please, sign in to be able to submit a new answer.