Skip to content

Commit 68cea87

Browse files
Update overview-local-cache.md
1 parent 0b2517d commit 68cea87

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

articles/app-service/overview-local-cache.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ tags: optional
55

66
ms.assetid: e34d405e-c5d4-46ad-9b26-2a1eda86ce80
77
ms.topic: article
8-
ms.date: 06/29/2023
8+
ms.date: 02/28/2025
99
ms.custom: UpdateFrequency3
1010
ms.author: msangapu
1111
author: msangapu-msft
@@ -14,10 +14,10 @@ author: msangapu-msft
1414
# Azure App Service Local Cache overview
1515

1616
> [!NOTE]
17-
> Local cache is not supported in function apps or containerized App Service apps, such as in [Windows Containers](quickstart-custom-container.md?pivots=container-windows) or in [App Service on Linux](overview.md#app-service-on-linux). A version of local cache that is available for these app types is [App Cache](https://github.com/Azure-App-Service/KuduLite/wiki/App-Cache).
17+
> Local cache isn't supported in function apps or containerized App Service apps, such as in [Windows Containers](quickstart-custom-container.md?pivots=container-windows) or in [App Service on Linux](overview.md#app-service-on-linux). A version of local cache that is available for these app types is [App Cache](https://github.com/Azure-App-Service/KuduLite/wiki/App-Cache).
1818
1919

20-
Azure App Service content is stored on Azure Storage and is surfaced in a durable manner as a content share. This design is intended to work with a variety of apps and has the following attributes:
20+
Azure App Service content is stored on Azure Storage and is surfaced in a durable manner as a content share. This design is intended to work with a various apps and has the following attributes:
2121

2222
* The content is shared across multiple virtual machine (VM) instances of the app.
2323
* The content is durable and can be modified by running apps.
@@ -29,30 +29,30 @@ While many apps use one or all of these features, some apps just need a high-per
2929
The Azure App Service Local Cache feature provides a web role view of your content. This content is a write-but-discard cache of your storage content that is created asynchronously on-site startup. When the cache is ready, the site is switched to run against the cached content. Apps that run on Local Cache have the following benefits:
3030

3131
* They are immune to latencies that occur when they access content on Azure Storage.
32-
* They are not affected by connection issues to the storage, since the read-only copy is cached on the worker.
32+
* They aren't affected by connection issues to the storage, since the read-only copy is cached on the worker.
3333
* They have fewer app restarts due to storage share changes.
3434

3535
> [!NOTE]
3636
> If you are using Java (Java SE, Tomcat, or JBoss EAP), then by default the Java artifacts--.jar, .war, and .ear files--are copied locally to the worker. If your Java application depends on read-only access to other files as well, set `JAVA_COPY_ALL` to `true` for those files to also be copied. If Local Cache is enabled, it takes precedence over this Java-specific enhancement.
3737
3838
## How the local cache changes the behavior of App Service
3939
* _D:\home_ points to the local cache, which is created on the VM instance when the app starts up. _D:\local_ continues to point to the temporary VM-specific storage.
40-
* The local cache contains a one-time copy of the _/site_ and _/siteextensions_ folders of the shared content store, at _D:\home\site_ and _D:\home\siteextensions_, respectively. The files are copied to the local cache when the app starts. The size of the two folders for each app is limited to 1 GB by default, but can be increased to 2 GB. Note that as the cache size increases, it will take longer to load the cache. If you've increased local cache limit to 2 GB and the copied files exceed the maximum size of 2 GB, App Service silently ignores local cache and reads from the remote file share.
40+
* The local cache contains a one-time copy of the _/site_ and _/siteextensions_ folders of the shared content store, at _D:\home\site_ and _D:\home\siteextensions_, respectively. The files are copied to the local cache when the app starts. The size of the two folders for each app is limited to 1 GB by default, but can be increased to 2 GB. As the cache size increases, it takes longer to load the cache. If you've increased local cache limit to 2 GB and the copied files exceed the maximum size of 2 GB, App Service silently ignores local cache and reads from the remote file share.
4141
> [!IMPORTANT]
4242
> When the copied files exceed the defined Local Cache size limit or when no limit is defined, deployment and swapping operations may fail with an error. See the [FAQ](#frequently-asked-questions-faq) for more information.
4343
>
44-
* The local cache is read-write. However, any modification is discarded when the app moves virtual machines or gets restarted. Do not use the local cache for apps that store mission-critical data in the content store.
44+
* The local cache is read-write. However, any modification is discarded when the app moves virtual machines or gets restarted. Don't use the local cache for apps that store mission-critical data in the content store.
4545
* _D:\home\LogFiles_ and _D:\home\Data_ contain log files and app data. The two subfolders are stored locally on the VM instance, and are copied to the shared content store periodically. Apps can persist log files and data by writing them to these folders. However, the copy to the shared content store is best-effort, so it is possible for log files and data to be lost due to a sudden crash of a VM instance.
4646
* [Log streaming](troubleshoot-diagnostic-logs.md#stream-logs) is affected by the best-effort copy. You could observe up to a one-minute delay in the streamed logs.
4747
* In the shared content store, there is a change in the folder structure of the _LogFiles_ and _Data_ folders for apps that use the local cache. There are now subfolders in them that follow the naming pattern of "unique identifier" + time stamp. Each of the subfolders corresponds to a VM instance where the app is running or has run.
48-
* Other folders in _D:\home_ remain in the local cache and are not copied to the shared content store.
48+
* Other folders in _D:\home_ remain in the local cache and aren't copied to the shared content store.
4949
* App deployment through any supported method publishes directly to the durable shared content store. To refresh the _D:\home\site_ and _D:\home\siteextensions_ folders in the local cache, the app needs to be restarted. To make the lifecycle seamless, see the information later in this article.
5050
* The default content view of the SCM site continues to be that of the shared content store.
5151

5252
## Enable Local Cache in App Service
5353

5454
> [!NOTE]
55-
> Local Cache is not supported in the **F1** or **D1** tier.
55+
> Local Cache isn't supported in the **F1** or **D1** tier.
5656
5757
You configure Local Cache by using a combination of reserved app settings. You can configure these app settings by using the following methods:
5858

@@ -89,7 +89,7 @@ You enable Local Cache on a per-web-app basis by using this app setting:
8989
```
9090

9191
## Change the size setting in Local Cache
92-
By default, the local cache size is **1 GB**. This includes the /site and /siteextensions folders that are copied from the content store, as well as any locally created logs and data folders. To increase this limit, use the app setting `WEBSITE_LOCAL_CACHE_SIZEINMB`. You can increase the size up to **2 GB** (2000 MB) per app. Note that it will take longer to load local cache as the size increases.
92+
By default, the local cache size is **1 GB**. This includes the /site and /siteextensions folders that are copied from the content store, as well as any locally created logs and data folders. To increase this limit, use the app setting `WEBSITE_LOCAL_CACHE_SIZEINMB`. You can increase the size up to **2 GB** (2000 MB) per app. It takes longer to load local cache as the size increases.
9393

9494
## Best practices for using App Service Local Cache
9595
We recommend that you use Local Cache in conjunction with the [Staging Environments](../app-service/deploy-staging-slots.md) feature.
@@ -98,29 +98,29 @@ We recommend that you use Local Cache in conjunction with the [Staging Environme
9898
* Create a **Staging** slot and publish to your Staging slot. You typically don't set the staging slot to use Local Cache to enable a seamless build-deploy-test lifecycle for staging if you get the benefits of Local Cache for the production slot.
9999
* Test your site against your Staging slot.
100100
* When you are ready, issue a [swap operation](../app-service/deploy-staging-slots.md#Swap) between your Staging and Production slots.
101-
* Sticky settings include name and sticky to a slot. So when the Staging slot gets swapped into Production, it inherits the Local Cache app settings. The newly swapped Production slot will run against the local cache after a few minutes and will be warmed up as part of slot warmup after swap. So when the slot swap is complete, your Production slot is running against the local cache.
101+
* Sticky settings include name and sticky to a slot. So when the Staging slot gets swapped into Production, it inherits the Local Cache app settings. The newly swapped Production slot runs against the local cache after a few minutes and will be warmed up as part of slot warmup after swap. So when the slot swap is complete, your Production slot is running against the local cache.
102102

103103
## Frequently asked questions (FAQ)
104104

105105
### What if Local Cache size limit is exceeded?
106-
When the copied files exceed the Local Cache size limit, the app will read from the remote share. However, deployment and swap operations may fail with an error. See the table below for size limits and results.
106+
When the copied files exceed the Local Cache size limit, the app reads from the remote share. However, deployment and swap operations may fail with an error. See the table below for size limits and results.
107107

108108
| **Local Cache size** | **Coped files** | **Result** |
109109
| --- | --- | --- |
110110
|≤ 2 GB|≤ Local Cache size|Reads from local cache.|
111111
|≤ 2 GB|> Local Cache size|Reads from remote share.<br/> **Note:** Deployment and swap operations may fail with an error.|
112112

113113
### How can I tell if Local Cache applies to my app?
114-
If your app needs a high-performance, reliable content store, does not use the content store to write critical data at runtime, and is less than 2 GB in total size, then the answer is "yes"! To get the total size of your /site and /siteextensions folders, you can use the site extension "Azure Web Apps Disk Usage."
114+
If your app needs a high-performance, reliable content store, doesn't use the content store to write critical data at runtime, and is less than 2 GB in total size, then the answer is "yes"! To get the total size of your /site and /siteextensions folders, you can use the site extension "Azure Web Apps Disk Usage."
115115

116116
### How can I tell if my site has switched to using Local Cache?
117-
If you're using the Local Cache feature with Staging Environments, the swap operation does not complete until Local Cache is warmed up. To check if your site is running against Local Cache, you can check the worker process environment variable `WEBSITE_LOCALCACHE_READY`. Use the instructions on the [worker process environment variable](https://github.com/projectkudu/kudu/wiki/Process-Threads-list-and-minidump-gcdump-diagsession#process-environment-variable) page to access the worker process environment variable on multiple instances.
117+
If you're using the Local Cache feature with Staging Environments, the swap operation doesn't complete until Local Cache is warmed up. To check if your site is running against Local Cache, you can check the worker process environment variable `WEBSITE_LOCALCACHE_READY`. Use the instructions on the [worker process environment variable](https://github.com/projectkudu/kudu/wiki/Process-Threads-list-and-minidump-gcdump-diagsession#process-environment-variable) page to access the worker process environment variable on multiple instances.
118118

119-
### I just published new changes, but my app does not seem to have them. Why?
119+
### I published new changes, but my app doesn't seem to have them. Why?
120120
If your app uses Local Cache, then you need to restart your site to get the latest changes. Don’t want to publish changes to a production site? See the slot options in the previous best practices section.
121121

122122
> [!NOTE]
123-
> The [run from package](deploy-run-package.md) deployment option is not compatible with local cache.
123+
> The [run from package](deploy-run-package.md) deployment option isn't compatible with local cache.
124124
125125
### Where are my logs?
126126
With Local Cache, your logs and data folders do look a little different. However, the structure of your subfolders remains the same, except that the subfolders are nestled under a subfolder with the format "unique VM identifier" + time stamp.
@@ -135,7 +135,7 @@ As part of the step that copies the storage content, any folder that is named re
135135
To flush the local cache logs, stop and restart the app. This action clears the old cache.
136136

137137
### Why does App Service starts showing previously deployed files after a restart when Local Cache is enabled?
138-
In case App Service starts showing previously deployed files on a restart, check for the presence of the App Setting - '[WEBSITE_DISABLE_SCM_SEPARATION=true](https://github.com/projectkudu/kudu/wiki/Configurable-settings#use-the-same-process-for-the-user-site-and-the-scm-site)'. After adding this setting any deployments via KUDU start writing to the local VM instead of the persistent storage. Best practices mentioned above in this article should be leveraged, wherein the deployments should always be done to the staging slot which does not have Local Cache enabled.
138+
In case App Service starts showing previously deployed files on a restart, check for the presence of the App Setting - '[WEBSITE_DISABLE_SCM_SEPARATION=true](https://github.com/projectkudu/kudu/wiki/Configurable-settings#use-the-same-process-for-the-user-site-and-the-scm-site)'. After adding this setting any deployments via KUDU start writing to the local VM instead of the persistent storage. Best practices mentioned above in this article should be leveraged, wherein the deployments should always be done to the staging slot which doesn't have Local Cache enabled.
139139

140140
## More resources
141141

0 commit comments

Comments
 (0)