Skip to content

Commit 9ebe354

Browse files
Merge pull request #301966 from halkazwini/afd-caching
Empty files note
2 parents bb165fb + 81fed00 commit 9ebe354

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

articles/frontdoor/front-door-caching.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Only requests that use the `GET` request method are cacheable. All other request
3030

3131
Azure Front Door delivers large files without a cap on file size. If caching is enabled, Front Door uses a technique called *object chunking*. When a large file is requested, Front Door retrieves smaller pieces of the file from the origin. After Front Door receives a full file request or byte-range file request, the Front Door environment requests the file from the origin in chunks of 8 MB.
3232

33-
After the chunk arrives at the Azure Front Door environment, it's cached and immediately served to the user. Front Door then prefetches the next chunk in parallel. This prefetch ensures that the content stays one chunk ahead of the user, which reduces latency. This process continues until the entire file gets downloaded (if requested) or the client closes the connection. For more information on the byte-range request, read [RFC 7233](https://www.rfc-editor.org/info/rfc7233).
33+
After the chunk arrives at the Azure Front Door environment, it's cached and immediately served to the user. Front Door then prefetches the next chunk in parallel. This prefetch ensures that the content stays one chunk ahead of the user, which reduces latency. This process continues until the entire file gets downloaded (if requested) or the client closes the connection. For more information on the byte-range request, see [RFC 7233](https://www.rfc-editor.org/info/rfc7233).
3434

3535
Front Door caches any chunks as they're received so the entire file doesn't need to be cached on the Front Door cache. Subsequent requests for the file or byte ranges are served from the cache. If the chunks aren't all cached, prefetching is used to request chunks from the origin.
3636

@@ -208,7 +208,7 @@ The following request headers don't get forwarded to the origin when caching is
208208
- `Vary`
209209

210210
> [!NOTE]
211-
> Requests that include authorization header will not be cached, unless the response contains a Cache-Control directive that allows caching. The following Cache-Control directives have such an effect: must-revalidate, public, and s-maxage.
211+
> Requests that include authorization header won't be cached, unless the response contains a Cache-Control directive that allows caching. The following Cache-Control directives have such an effect: must-revalidate, public, and s-maxage.
212212
213213
## Response headers
214214

@@ -221,6 +221,9 @@ In addition, Front Door attaches the `X-Cache` header to all responses. The `X-C
221221
- `PRIVATE_NOSTORE`: Request can't be cached because the *Cache-Control* response header is set to either *private* or *no-store*.
222222
- `CONFIG_NOCACHE`: Request is configured to not cache in the Front Door profile.
223223

224+
> [!NOTE]
225+
> Azure Front Door strips the `Content-Type` header for empty files when caching is enabled. To continue sending this header to clients, use Azure Front Door rules engine (Action - Modify response header, Operator - Overwrite, Header name - Content-Type) to manually override it for such files. You also can disable caching for empty files, but this approach is less recommended as it increases the load on your origin and may impact performance.
226+
224227
## Logs and reports
225228

226229
::: zone pivot="front-door-standard-premium"
@@ -250,7 +253,7 @@ Cache behavior and duration can be configured in Rules Engine. Rules Engine cach
250253
* **Override if origin missing**: If the origin doesn’t return caching TTL values, Azure Front Door uses the specified cache duration. This behavior only applies if the response is cacheable.
251254

252255
> [!NOTE]
253-
> * Azure Front Door makes no guarantees about the amount of time that the content is stored in the cache. Cached content may be removed from the edge cache before the content expiration if the content is not frequently used. Front Door might be able to serve data from the cache even if the cached data has expired. This behavior can help your site to remain partially available when your origins are offline.
256+
> * Azure Front Door makes no guarantees about the amount of time that the content is stored in the cache. Cached content may be removed from the edge cache before the content expiration if the content isn't frequently used. Front Door might be able to serve data from the cache even if the cached data has expired. This behavior can help your site to remain partially available when your origins are offline.
254257
> * Origins may specify not to cache specific responses using the Cache-Control header with a value of no-cache, private, or no-store. When used in an HTTP response from the origin server to the Azure Front Door POPs, Azure Front Door supports Cache-control directives and honors caching behaviors for Cache-Control directives in [RFC 7234 - Hypertext Transfer Protocol (HTTP/1.1): Caching (ietf.org)](https://www.rfc-editor.org/rfc/rfc7234#section-5.2.2.8).
255258
256259
::: zone-end
@@ -266,8 +269,8 @@ Cache behavior and duration can be configured in both the Front Door designer ro
266269
* When *Use cache default duration* is set to **No**, Azure Front Door (classic) always override with the *cache duration* (required fields), meaning that it caches the contents for the cache duration ignoring the values from origin response directives.
267270

268271
> [!NOTE]
269-
> * Azure Front Door (classic) makes no guarantees about the amount of time that the content is stored in the cache. Cached content may be removed from the edge cache before the content expiration if the content is not frequently used. Azure Front Door (classic) might be able to serve data from the cache even if the cached data has expired. This behavior can help your site to remain partially available when your origins are offline.
270-
> * The *cache duration* set in the Front Door designer routing rule is the **minimum cache duration**. This override won't work if the cache control header from the origin has a greater TTL than the override value.
272+
> * Azure Front Door (classic) makes no guarantees about the amount of time that the content is stored in the cache. Cached content may be removed from the edge cache before the content expiration if the content isn't frequently used. Azure Front Door (classic) might be able to serve data from the cache even if the cached data has expired. This behavior can help your site to remain partially available when your origins are offline.
273+
> * The *cache duration* set in the Front Door designer routing rule is the **minimum cache duration**. This override doesn't work if the cache control header from the origin has a greater TTL than the override value.
271274
>
272275
273276
::: zone-end

0 commit comments

Comments
 (0)