Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I turn off HTTP caching for an Azure App Service Web App if my app is just a simple HTML page?

I presently have an application that's just an HTML page (with a bunch of JavaScript making calls to a bunch of API's to make it look interactive).

But at the end of the day, presently, my entire app is just a single HTML page.

I deployed it on Azure App Service as a Web App.

I want to turn off HTTP caching everywhere -- server, intermediaries / proxies, and the client. How do I do that without resorting to the not-recommended HTML <meta> tags?

I am looking at the Application Settings for the App Service but I don't see any option to turn off caching. I am presently on the F1 tier App Service Plan that's free, so I am guessing that's why they won't let me access the web server settings because it's (actually even lower than) shared across other apps of other customers?

But can you confirm that a Basic or upwards plan will let you control server options for an App Service (and not for a VM you have provisioned)?

like image 843
Water Cooler v2 Avatar asked Oct 22 '25 04:10

Water Cooler v2


1 Answers

You can disable Local Cache on a per-web-app basis by using this app setting: WEBSITE_LOCAL_CACHE_OPTION = Never.

By upgrading to Not-Free plans you will get lots of benefits but local caching is not one of them. https://azure.microsoft.com/en-us/pricing/details/app-service/plans/

like image 167
Kamran Avatar answered Oct 23 '25 17:10

Kamran