Sitecore Azure Local Cache Management
Azure Local Cache is a great feature for keeping your Sitecore pages served in the case that the underlying Sitecore PaaS instance is down. Having said that, here a few tips to manage the Azure Local Cache.
Please reference the following for more details: Local cache – Azure App Service | Microsoft Learn
Don’t Use on a CM (Content Management) Instance
The CMS is not serving public traffic and with all the constant changes (ex. deployments, content, etc.), caching is not desired. Also, you should only have one CM instance as multiple instances of a Sitecore CMS could cause issues as their jobs (ex. indexing and publishing) execute.
Do Use on Your CD Instances
Local Cache is intended to give you users pages in case the underlying application is down. The CD is what serves your users and where Azure Local Cache should be enabled. Add the following two settings to your CD App Service Configuration to enable Local Cache and maximize the cache it can hold (2GB max):
WEBSITE_LOCAL_CACHE_OPTION Always
WEBSITE_LOCAL_CACHE_SIZEINMB 2000
Don’t Enable on Deployment Slots
Deployment slots are where you warm up your app and review before swapping into the primary slot. You should warm up the application first, ensure all pages are showing as desired, then swap into the primary slot and let the primary slot cache what is intended.
Sticky settings include name and sticky to a slot. So when the Staging slot gets swapped into Production, it inherits the Local Cache app settings. The newly swapped Production slot will run against the local cache after a few minutes and will be warmed up as part of slot warmup after swap. So when the slot swap is complete, your Production slot is running against the local cache.
Local cache – Azure App Service | Microsoft Learn