Azure App Service Local Cache

By default, the content of your Azure App Service site is actually stored in Azure Storage and shared between the app service instances. Whenever the servers hosting your Azure Storage contents are updated (be it Windows Update or whatever), your app service will be restarted in order to point it to the new host for your files.

Azure App Service Local Cache improves performance and web app uptime by copying your files to local storage. It does so by introducing a local cache on each web app instance.

More exactly:

  • When you web app starts, it copies the files from central Azure Storage to your local cache.

  • The local cache handles reads and writes, but the writes are never sent to the central Azure Storage.

  • When you restart your app, it will discard the local cache and reread the files from the central Azure Storage.

  • When publishing changes (for example from Visual Studio), they don't become visible to your apps until restarted.

  • This gives you much better file read/write performance for your website. It also means you get fewer restarts due to Azure Storage Share changes (but you need to restart after publishing your app).

To summarize, you won’t get restarts due to “File Server Upgrades”

The Local Cache feature will host all files in /site or /siteextensions

Local Cache is not supported in the F1 or D1 tier.

I just published new changes, but my app does not seem to have them. Why?

If your app uses Local Cache, then you need to restart your site to get the latest changes.

Site not updating with Local Cache Option Set to Always. You can disable the local cache by setting the WEBSITE_LOCAL_CACHE_OPTION to Never in your application settings, make your updates, and then re-enable it if necessary. Or you have to restart app service after deployment.

How to enable Local Cache

To enable Local Cache, you set WEBSITE_DYNAMIC_CACHE=0 and WEBSITE_LOCAL_CACHE_OPTION=Always.

Navigate App Service Panel, click Configuration, add +New application setting


  • Checked the "Deployment slot setting" checkbox


  • Checked the "Deployment slot setting" checkbox

  • Save (It restarts the app service)

By default, the local cache size is 1 GB. If your content size is over 1 GB you can change the limit up to 2 GB

Azure App Service Dynamic Cache

The Dynamic Cache is similar to Local Cache, with one major difference:

Files written by your web app will be persisted.

This means:

The dynamic cache handles reads and writes. The writes are sent to the central Azure Storage. Other web app instances will get the updated files, but there is a delay (around 10 seconds). When publishing changes (for example from Visual Studio), there is also a delay until it propagates to the web app caches.

To enable Dynamic Cache, you set WEBSITE_DYNAMIC_CACHE=1 (or 2) and WEBSITE_LOCAL_CACHE_OPTION=Never.

WEBSITE_DYNAMIC_CACHE=1 means both files and their metadata are cached. WEBSITE_DYNAMIC_CACHE=2 means only metadata is cached. This makes the cache much smaller, but you don't get the same performance increase.

How do I verify that the web app's local cache instance is serving up the content and not from a shared network location?

You will need to navigate to; and find the properties column for the w3p without the scm tag. Click Properties. And switch the Environment Variables, switch down to end of page, find WEBSITE_LOCALCACHE_READY, TRUE

Or you can check this URL :

Find the following record :

For more information: