Cloudflare ignores "cache-control: no-store" header


It would appear that Cloudflare ignores the Cache-Control: no-store header when Cache Level: Cache Everything is turned on in page rules. Is this by design?

Basically, we want to cache everything on our website unless our server sends a Cache-Control: no-store header.

How can we achieve that?

Thanks for your help!

PS: Here’s the sample page: Donate - World History Encyclopedia

Here are the response headers:

age: 423
alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400, h3-28=":443"; ma=86400, h3-27=":443"; ma=86400
cache-control: no-store
cdn-cache-control: stale-if-error=60
cf-cache-status: HIT
cf-ray: 6ab939a5eab9f1c2-ATL
content-encoding: br
content-security-policy: frame-ancestors 'self'
content-type: text/html; charset=UTF-8
date: Tue, 09 Nov 2021 18:50:10 GMT
expect-ct: max-age=604800, report-uri=""
expires: Tue, 09 Nov 2021 18:43:07 GMT

Notice how cf-cache-status: HIT contradicts cache-control: no-store.

Ok, so it would appear that the solution lies in the CDN-Cache-Control header.

We’re now sending the following cache-control headers from the server:

cache-control: no-store
cdn-cache-control: no-store

This does appear to override Cloudflare’s preference for caching when the Cache-Everything page rule is active.

1 Like

¡Hola @whencyclopedia!

Happy :taco: Tuesay!

Yup! It is further detailed in

1 Like

Yes, I did find that page after about an hour of googling. :wink:

It’s a little counter-intuitive that Cloudflare would just ignore a cache-control: no-store header, though. Maybe it would be good if your documentation on the Cache Everything page rule were to include a warning that this header is ignored.

In any case, problem solved for us. :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.