What is Local Cache?

Local cache is a new feature of Azure app Service, as by using it, the site content is read, written from the local virtual machine instance to improve the performance and instead of retrieving it from Azure storage, Azure storage is used to store app Service content.

When to use local cache feature?

When the Applications in app Service has the static data as read data, not the writable data and the Application has the demand of high performance, then the local cache is the suitable option.

Below are some points related to local cache,

To complete this tutorial, you'll need the following,

How to enable local cache in app Service, using Azure portal:

  1. Login to Azure Portal.

  2. Got to the Web app for which the Local Cache has to enable. In the Web app blade, go to All Settings. In the settings blade, select Application settings, which opens the Application settings blade, as shown in the image, given below:

    settings

  3. In the highlighted App settings section, enter the WEBSITE_LOCAL_CACHE_OPTION in key. In Value text box, save the changes as shown in the image, given below. Select Slot setting checkbox, if we have to keep this setting as slot specific, otherwise this setting will swap when we have the deployment slots other than production, and we perform swapping.

    save

I have added both the settings WEBSITE_LOCAL_CACHE_OPTION and WEBSITE_LOCAL_CACHE_SIZEINMB. If we don’t provide WEBSITE_LOCAL_CACHE_SIZEINMB, the default value for it will be 300 MB. If we need more size, up to 1GB, we need to provide this setting. Finally click Save to save App setting changes that we made to enable the local cache.