Open In App

Microsoft Azure – Enable Local Cache on Azure App

Last Updated : 31 Mar, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

The Azure App Service local cache feature provides a web role view of content. This content is a writer but discards the cache of your storage container that is created asynchronously on-site startup. Apps that run on local cache have the following benefits: 

  • They are immune to latencies that occur when they access content on Azure storage.
  • They’re immune to the plan upgrades or unplanned downtimes and any other disruptions with Azure storage that occur on servers that serve the content share.
  • They have fewer app restarts due to storage share changes.

Implementation:

Follow the below steps to enable local cache on Azure App:

Step 1: To enable this feature,  first navigate to the configuration blade. You can enable this feature via an application setting by clicking here. 

 

Step 2: Then simply add the setting name. Website local cache option. Set the value to always. And if you want this setting to apply to all the slots and for this app service check the box here and click OK. 

 

Note: The default cache size is 1000 megabytes. The local cache contains a one-time copy of the site and site extensions folders of the shared content store. If your site and site extensions folders exceed 1000 megabytes, you can increase this size to a maximum of 2000 megabytes.

Step 3:  In order to increase the cache size, simply add another application set with a name. Website local cache size in megabytes and you can set this to a maximum value of 2000 megabytes.

 

  • If that value is set and if your site and site extensions folders combine to exceed 2000 megabytes app services will silently ignore the local cache and read from the remote file share instead. If the website local cache size in the megabytes option is not defined, or if it is defined to any value less than 2000 megabytes, the deployment or swap may fail with an error.

Step 4:  Now, once these settings are defined,  go ahead and click save, and the local cache will be enabled.

 

Hence, this is how you can enable local cache on an Azure App Service.


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads