Cache issue with images post Deployment

James Cordrey 0 Reputation points
2023-10-20T16:26:53.83+00:00

Hey everyone,

We have an Azure app service in our Production environment that's exhibiting a weird issue for us. Basically we deploy a set of images out to our AppService (In our assets/images folder) and they have inconsistent updates on our sites. I have one user who is seeing an image we had deployed out 3 months ago, and all other users are seeing the image we had out yesterday, not the one that was deployed this morning.

This happens in incognito browsers, every browser. I went into the developer tools and turned caching off in the browser, and even tried a browser that was freshly installed. This happens on all device types, so far as I can tell. (Tested three versions of Windows, A couple of versions of Android, and one Macbook)

The app service has been restarted twice today.

We have one domain pointed towards this app service, and that's what we've been testing on. When we use the azurewebsites.net domain, however, we see the new version of the images. (We never use this link, though - I only had users try it this morning to be thorough.) I even had a user who has never been to the site before check the URL and they were getting the wrong image. This happens on the page, and when going to the image directly. It also happens if I delete the image in the app service editor, too.

When I add ?gibberish to the URL, I get the correct image. So we can edit the cshtml file to make it "work" temporarily, but this is a long-running issue we've had and we'd like to get it properly resolved. Since adding a cachebuster to the image url worked, I logged in to Kudu to check cache settings. All of the cache variables appear to be off. I'll list what I'm seeing related to cache below. At this point, I'm at a loss for what to do next - any suggestions or feedback would be greatly appreciated.

Thanks.

AppSettings
WEBSITE_DYNAMIC_CACHE = 0

Environment Variables
APPSETTING_WEBSITE_DYNAMIC_CACHE = 0
DOTNET_HOSTING_OPTIMIZATION_CACHE = C:\DotNetCache
WEBSITE_DYNAMIC_CACHE = 0
WEBSITE_LOCALCACHE_ENABLED = False
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.