Cache everything except no-cache
i want to cache everything that cache control is not on no-cache but i dont see how
11 Replies
this is my cache rule
i just want to cahce the things that his cache-control is not to no-cahe
is that so dificult?
I am confused. You want to cache things that have a cache control header and ignore if it doesn't?
i want to cache everything
except the ones that have nocache
Try "no-store" instead.
I Will try thx
can i do
no-cache no-store no-transform
?
cloudfare does what it wants and auto modifies it to that
here is my rule
@DarkDeviLThat depends what exactly you want to do, ... "
no-cache
" actually allows caching, but requires re-validation every single time, which is why I suggested you to try "no-store
", according to your explanation.
If you want to mix multiple options, you can do so, but would need to comma separate, e.g.:
Given this rule, I would say that:
max-age=2678400
here would appear to come from your origin.how should my cache rule
should be
That would depend on what exactly you're looking to do.
And whether you want your origin to control it using e.g. Cache-Control as it seems like you've been trying to.
Or if you would just let Cloudflare handle it for you (and thereby ignore e.g. the Cache-Control from the origin).
Your check mark on "
[x] Use cache-control header if present, bypass cache if not
" suggests that you want to control the cache from your origin with Cache-Control
, and if there are no Cache-Control
set from the origin (or any intermediate between Cloudflare and the origin), you do not want Cloudflare to cache the content.AND IF i want to store it
cause i want to store all
except the ones with no-store
that could work too
if cache control is not sent
dont cache
if it is
cache for 4 hours
so it should be like this
To cache for 4 hours, with the above setting, you would need to set something like e.g. "
Cache-Control: max-age=14400
" or "Cache-Control: s-maxage=14400
" from your origin, for those things that yo want to cache for 4 hours (14400 seconds).
If your origin (the server behind Cloudflare) sends "Cache-Control: max-age=2678400
" to Cloudflare, like it appears above, then you're instructing Cloudflare to cache it for 31 days.i think you saved my life 🥹