Skip to content

Commit bde6874

Browse files
authored
[Cache] ELI5 on concepts pages (#30605)
1 parent c73d21d commit bde6874

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

src/content/docs/cache/concepts/cache-behavior.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ tags:
99
- Cookies
1010
---
1111

12-
In this page, we document how Cloudflare's cache system behaves in interaction with:
12+
This page describes how Cloudflare's cache system behaves in interaction with:
1313

1414
* `HEAD` requests
1515
* `Set-Cookie` response headers
@@ -18,7 +18,7 @@ In this page, we document how Cloudflare's cache system behaves in interaction w
1818

1919
Cloudflare converts `HEAD` requests to `GET` requests for [cacheable requests](/cache/concepts/default-cache-behavior/#default-cached-file-extensions).
2020

21-
When you make a `HEAD` request for a cacheable resource and Cloudflare does not have that resource in the edge cache, a cache miss happens. Cloudflare will send a `GET` request to your origin, cache the full response and return the response headers only. Make sure the origin server is setup to handle `GET` requests, even if only `HEAD` requests are expected, so that compatibility with this behavior is ensured.
21+
When you make a `HEAD` request for a cacheable resource and Cloudflare does not have that resource in the edge cache, a cache miss happens. Cloudflare will send a `GET` request to your origin, cache the full response and return the response headers only. Make sure the origin server is set up to handle `GET` requests, even if only `HEAD` requests are expected, so that compatibility with this behavior is ensured.
2222

2323
## Interaction of `Set-Cookie` response header with Cache
2424

src/content/docs/cache/concepts/cache-control.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ With the Origin Cache Control feature enabled, `Cache-Control` directives presen
2121

2222
Cloudflare's [Cache Rules](/cache/how-to/cache-rules/) allows users to either augment or override an origin server's `Cache-Control` headers or [default policies](/cache/concepts/default-cache-behavior/) set by Cloudflare.
2323

24-
In the following sections, we will provide more details regarding:
24+
The following sections cover:
2525

2626
* The most common `Cache-Control` directives.
2727
* How to enable Origin Cache Control.
@@ -303,7 +303,7 @@ This configuration indicates the asset is fresh for 600 seconds. The asset can b
303303

304304
## Interaction with other Cloudflare features
305305

306-
In this section, we provide details regarding how other Cloudflare features interact with `Cache-Control` directives.
306+
This section covers how other Cloudflare features interact with `Cache-Control` directives.
307307

308308
### Edge Cache TTL
309309

src/content/docs/cache/concepts/default-cache-behavior.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Cloudflare’s CDN provides several cache customization options:
9090

9191
Customers can reduce the **Maximum Upload Size** from the zone's **Network** page.
9292

93-
If you require a larger upload, you can group requests into smaller chunks, upload the full resource through an [unproxied (grey-clouded) DNS record](/dns/proxy-status/) or [upgrade your plan](/billing/manage/change-plan/).
93+
If you require a larger upload, you can group requests into smaller chunks, upload the full resource through a [DNS-only (unproxied) DNS record](/dns/proxy-status/) or [upgrade your plan](/billing/manage/change-plan/).
9494

9595
### Cacheable size limits
9696

src/content/docs/cache/concepts/retention-vs-freshness.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ In the context of Cloudflare CDN (Content Delivery Network), retention and fresh
1111

1212
## Retention
1313

14-
When a file or resource is requested from a website, Cloudflare caches it to avoid having to ask the origin server for it again the next time it is requested, reducing latency and improving delivery speed. But if an object in cache does not get requested again, eventually it will be removed to make room for newer, more popular objects. This process is called eviction and is a standard part of cache management. When the cache wants to store a new object but does not have room, it uses an algorithm called Least Recently Used, or LRU, to nominate an object to evict and replace it with the new one. An object’s cache retention period refers to the duration the object is stored in Cloudflare’s cache before being evicted. It is worth noting that an object’s retention period is a function of its relative popularity and the size of Cloudflare’s caches, and therefore is not configurable.
14+
When a resource is requested, Cloudflare caches it so that subsequent requests can be served without contacting the origin server. If a cached object is not requested again, it is eventually removed to make room for newer, more popular content. This removal process is called eviction.
15+
16+
Cloudflare uses a Least Recently Used (LRU) algorithm to decide which objects to evict when the cache is full. An object's retention period is how long it stays in cache before being evicted. Retention is determined by the object's relative popularity and the size of the cache, and is not configurable.
1517

1618
## Freshness (TTL)
1719

18-
The time window that an object should be considered safe for a cache to use is dictated by its freshness, also known as Time to Live (TTL). If an object has a TTL of five minutes that means that, starting from the moment the cache first receives the object, for the next five minutes the cache can use that object without checking with the origin again. After five minutes have passed, if Cloudflare gets another request for that object, we cannot use what is stored in the cache without first checking the origin to see if the object is still valid. Those first five minutes in this object’s case are its freshness period. There are a few ways to configure TTLs for resources served through Cloudflare’s Content Delivery Network:
20+
Freshness, also known as Time to Live (TTL), determines how long a cache can use an object without checking with the origin again. For example, if an object has a TTL of five minutes, the cache serves it directly for five minutes after first receiving it. After five minutes, Cloudflare must check with the origin to confirm the object is still valid before serving it again. There are a few ways to configure TTLs for resources served through Cloudflare's CDN:
1921

2022
* Include [Origin Cache Control](/cache/concepts/cache-control/) or [CDN Cache Control](/cache/concepts/cache-control/) directives, like `max-age` or `s-maxage`, in the origin cache-control response header.
2123

0 commit comments

Comments
 (0)