Does adding a pagerule invalidate the cache

If I add a new pagerule to my site, will it delete all the cached content in the CDN?


What settings you want to apply in one page rule?

If I’m not mistaken, only “Custom Cache Key” will purge the cache:

The rule in question is a cache bypass rule applying to a particular subdirectory.

It is obvious that some rules have to invalidate a subset of cached items.
But does CF have an intelligent system for invalidating affected items only?
Or does it just nuke the entire cache when a rule is added?

Couldflare’s cache is by default (not looking it up it’s a Saturday… exact answer is in the KB) scheme:// If you bypass cache or change the cache key as @erictung for rules that match the path the cache key changes. For everything else it remains unchanged. If you where @erictung and changed the cache key so that (for example) query string was now ignored a request does with query?string would no longer match (no query string in) the new rule so it would be a cache miss because the formula doesn’t match.

In your scenario the new rule would only apply to assets on the specific path. Other paths would not be impacted because the cache key is unchanged for those.

So the unimpacted paths would not be purged from the cache?

Items aren’t purged, the cache key change causes existing items under the old key not to match the new key.

1 Like

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