You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`s-maxage=0`| Will not cache. | Caches and always revalidates |
107
+
|`max-age=0`| Will not cache. | Caches and always revalidates. |
108
+
|`no-cache`| Will not cache. | Caches and always revalidates. Does not serve stale. |
109
+
|`no-cache=<headers>`| Will not cache. | Caches if headers mentioned in `no-cache=<headers>` do not exist. Always revalidates if any header mentioned in `no-cache=<headers>` is present.|
110
+
|`Private=<headers>`| Will not cache. | Does not cache `<headers>` values mentioned in `Private=<headers>` directive. |
111
+
|`must-revalidate`| Cache directive is ignored and stale is served. | Does not serve stale. Must revalidate for CDN and for browser. |
112
+
|`proxy-revalidate`| Cache directive is ignored and stale is served. | Does not serve stale. Must revalidate for CDN but not for browser. |
113
+
|`no-transform`| May (un)Gzip, Polish, email filter, etc. | Does not transform body. |
114
+
|`s-maxage=delta, delta>1`| Same as `max-age`. |`Max-age` and `proxy-revalidate`. |
115
+
|`immutable`| Not proxied downstream. | Proxied downstream. Browser facing, does not impact caching proxies. |
Copy file name to clipboardExpand all lines: src/content/docs/cache/concepts/cdn-cache-control.mdx
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -149,3 +149,22 @@ Behavior in response to 5XX error:
149
149
</tr>
150
150
</tbody>
151
151
</table>
152
+
153
+
## Understand `no-store` and `no-cache` directives
154
+
155
+
There is often confusion between the directives `Cache-Control: no-store` and `Cache-Control: no-cache`, particularly regarding how they impact browser caching and features like the [Back-Forward Cache](https://developer.mozilla.org/en-US/docs/Glossary/bfcache) (BFCache).
156
+
157
+
### `no-store`
158
+
159
+
- Tells both browsers and intermediaries (like CDNs) not to store a copy of the response under any circumstance.
160
+
- The response is never written to disk or memory, which means the browser must fetch it again every time.
161
+
- In many browsers, `no-store` disables BFCache, because restoring a page from BFCache requires the browser to keep a copy of the page's memory state, which contradicts the “do not store” directive.
162
+
- This directive is used for highly sensitive or dynamic data (for example, banking apps, personal information, secure dashboards).
163
+
164
+
### `no-cache`
165
+
166
+
- Allows storing of the response (in both browser and intermediate caches), but requires revalidation with the origin server before using it.
167
+
- This ensures the content is always up-to-date, while still potentially allowing BFCache or other forms of performance optimization.
168
+
- This directive is used for data that changes frequently but is not sensitive, and can be served faster if validated rather than re-downloaded.
169
+
170
+
For more information about how these directives behave when Origin Cache Control is enabled or disabled refer to the [Directives](/cache/concepts/cache-control/#directives) section.
0 commit comments