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
Copy file name to clipboardExpand all lines: src/content/docs/cache/concepts/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
@@ -89,6 +89,25 @@ Additional directives that influence cache behavior are listed below.
89
89
*`vary` — Cloudflare does not consider vary values in caching decisions. Nevertheless, vary values are respected when [Vary for images](/cache/advanced-configuration/vary-for-images/) is configured and when the vary header is [`vary: accept-encoding`](/speed/optimization/content/compression/).
90
90
*`immutable` — Indicates to clients the response body does not change over time. The resource, if unexpired, is unchanged on the server. The user should not send a conditional revalidation request, such as `If-None-Match` or `If-Modified-Since`, to check for updates, even when the user explicitly refreshes the page. This directive has no effect on public caches like Cloudflare, but does change browser behavior.
91
91
92
+
### Understand `no-store` and `no-cache` directives
93
+
94
+
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).
95
+
96
+
#### `no-store`
97
+
98
+
- Tells both browsers and intermediaries (like CDNs) not to store a copy of the response under any circumstance.
99
+
- The response is never written to disk or memory, which means the browser must fetch it again every time.
100
+
- 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.
101
+
- This directive is used for highly sensitive or dynamic data (for example, banking apps, personal information, secure dashboards).
102
+
103
+
#### `no-cache`
104
+
105
+
- Allows storing of the response (in both browser and intermediate caches), but requires revalidation with the origin server before using it.
106
+
- This ensures the content is always up-to-date, while still potentially allowing BFCache or other forms of performance optimization.
107
+
- This directive is used for data that changes frequently but is not sensitive, and can be served faster if validated rather than re-downloaded.
108
+
109
+
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.
110
+
92
111
## Enable Origin Cache Control
93
112
94
113
If you enable Origin Cache Control, Cloudflare will aim to strictly adhere to [RFC 7234](https://datatracker.ietf.org/doc/html/rfc7234). Enterprise customers have the ability to select if Cloudflare will adhere to this behavior, enabling or disabling Origin Cache Control for their websites through cache rules in the [dashboard](/cache/how-to/cache-rules/settings/#origin-cache-control-enterprise-only) or via [API](/cache/how-to/cache-rules/settings/#origin-cache-control-enterprise-only). Free, Pro, and Business customers have this option enabled by default and cannot disable it.
Copy file name to clipboardExpand all lines: src/content/docs/cache/concepts/cdn-cache-control.mdx
-19Lines changed: 0 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -149,22 +149,3 @@ 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