Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/content/docs/cache/how-to/edge-browser-cache-ttl/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import { FeatureTable } from "~/components"

## Edge Cache TTL

Edge Cache TTL (Time to Live) specifies the maximum time to cache a resource in the Cloudflare global network. Edge Cache TTL is not visible in response headers and the minimum Edge Cache TTL depends on plan type.
Edge Cache TTL (Time to Live) specifies the maximum time to cache a resource in the Cloudflare global network. A longer Edge Cache TTL means more requests are served from cache, reducing load on your origin server. Edge Cache TTL is not visible in response headers and the minimum Edge Cache TTL depends on plan type.

<FeatureTable id="cache.edge_cache_ttl" />

For more information on how to set up Edge Cache TTL, refer to [Cache rules](/cache/how-to/cache-rules/settings/#edge-ttl).
For more information on how to configure Edge Cache TTL, refer to [Cache rules](/cache/how-to/cache-rules/settings/#edge-ttl).

## Browser Cache TTL

Expand All @@ -26,13 +26,13 @@ The Browser Cache TTL sets the expiration for resources cached in a visitor’s

Unless specifically set in a cache rule, Cloudflare does not override or insert `Cache-Control` headers if you set **Browser Cache TTL** to **Respect Existing Headers**.

:::note[Note]
:::note


* Setting high Browser Cache TTL values means that the assets will be cached for a long time by users’ browsers.
* Setting high Browser Cache TTL values means that the assets will be cached for a long time by users' browsers.
* If you modify cached assets, the new assets may not be displayed to repeat visitors before the Browser Cache TTL expires.
* Purging Cloudflare’s cache does not affect assets stored by a visitor’s browser.
:::
* Purging Cloudflare's cache does not affect assets stored by a visitor's browser.

:::

<FeatureTable id="cache.browser_cache_ttl" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,26 @@ Specify a time for a visitor’s Browser Cache TTL to accelerate the page load f

By default, Cloudflare honors the cache expiration set in your `Expires` and `Cache-Control` headers. Cloudflare overrides any `Cache-Control` or `Expires` headers with values set via the **Browser Cache TTL** option under **Caching** on your dashboard if:

* The value of the `Cache-Control` header from the origin web server is less than the **Browser Cache TTL** setting. This means that **Browser cache TTL** value needs to be higher than origin `max-age`.
* The value of the `Cache-Control` or `Expires` header from the origin web server is less than the **Browser Cache TTL** setting.
* The origin web server does not send a `Cache-Control` or an `Expires` header.

Unless specifically set in a [Cache Rule](/cache/how-to/cache-rules/), Cloudflare does not override or insert `Cache-Control` headers if you set **Browser Cache TTL** to **Respect Existing Headers**.

Nevertheless, the value you set via Cache Rule will be ignored if `Cache-Control: max-age` is higher. In other words, you can override to make browsers cache longer than Cloudflare's edge but not less.
The zone-level **Browser Cache TTL** setting respects whichever value is higher — the setting you configure or the origin `max-age`. To override the origin `max-age` regardless of its value, use a [Cache Rule](/cache/how-to/cache-rules/settings/#browser-ttl) with **Override origin** mode instead.

## Set Browser Cache TTL

:::note[Note]


If you modify cached assets, the new asset is not displayed to repeat visitors before the Browser Cache TTL duration. [Purging Cloudflare’s cache](/cache/how-to/purge-cache/) does not affect assets cached in a visitor’s browser.
:::note

If you modify cached assets, the new asset is not displayed to repeat visitors before the Browser Cache TTL duration. [Purging Cloudflare's cache](/cache/how-to/purge-cache/) does not affect assets cached in a visitor's browser.

:::

1. In the Cloudflare dashboard, go to the **Caching** page.
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login) and select your account and domain.
2. Go to **Caching** > **Configuration**.

<DashButton url="/?to=/:account/:zone/caching/configuration" />

2. Under **Browser Cache TTL**, select the desired cache expiration time from the drop-down menu.
3. Under **Browser Cache TTL**, select the desired cache expiration time from the dropdown menu.

The **Respect Existing Headers** option tells Cloudflare to honor the settings in the `Cache-Control` headers from your origin web server.
Loading