We have an Azure App Service hosting a Web App that includes static HTML and JS content. We have found that new JavaScript content we deploy to the Web Application is not updated in browsers until we Restart the Azure App Service. We use MSBUILD driven MSDeploy to publish.
We have confirmed via Kudu that the new versions of our Java Script files are there. The file sizes and modified date/time change with our deployments, as expected.
However if we hit them in a browser (e.g. http://mysite.azurewebsites.net/theFile.js) we see an older version of the file content. This is regardless of browser, after deleting cache, running in Incognito mode, running w/ Cache Disabled in F12 Tools -- always get the old content.
If we merely restart the App Service via the Portal and re-browse we get the new content. Viola, but what's going on?
The Azure App Service hosts an ASP.NET Web API application, at version 4.6.1, 64-bit, integrated pipeline, ARR off
, Always On on
.
The WebAPI application has a non-default Route defined that serves out a static HTML file. That file has a link to a static JS file stored in the same folder, side-by-side, as the HTML file. We've no specific route for the JS file...but didn't think that was necessary.
The environment variable WEBSITE_LOCALCACHE_ENABLED = False
.
Any tips or help greatly appreciated.