If you are experiencing an issue with your website hosted on an app service running multiple instances, where updated pages are not reflected across all user sessions, this article is for you. This problem typically manifests when users, connected to different app service instances via the ARRAffinity cookie, continue to see the previous version of a page even after it has been updated. You may have noticed that the issue is temporarily resolved by scaling down to a single instance or restarting the application. If you are using WebRequestCachingProvider as your Caching Provider and are unsure if this is the correct one, this guide will help you resolve the issue.
To resolve the issue of content not updating across all instances in a web farm, you need to switch the Caching Provider from WebRequestCachingProvider to a custom caching provider. An example of a custom caching provider can be found at https://github.com/davidjrh/dnn.rediscachingprovider. This change should resolve the issue of users seeing outdated versions of a page when connected to different app service instances.
Switching from WebRequestCachingProvider to a custom caching provider should resolve the issue of content not updating across all instances in a web farm. This ensures that all users, regardless of the app service instance they are connected to, will see the most recent version of a page.
Q: Can I use any custom caching provider?
A: Yes, as long as it is compatible with your app service and meets your requirements.
Q: Where can I find examples of custom caching providers?
A: One example can be found at https://github.com/davidjrh/dnn.rediscachingprovider.
Q: Will this solution work if I am running a single instance app service?
A: This solution is specifically for multi-instance app services. If you are running a single instance app service and experiencing similar issues, it may be due to a different problem.