Cache Revalidation
Hello,
I want to make a cache rule where if ?revalidate=1 is in the root pages url
eg
domain.com/?revalidate=1 it refreshes the cache on my root page
5 Replies
How do I do this?
I cant find anything under Cache Rules to revalidate a page
Strictly speaking, there is no feature that is "Call the path/page with a specific query URL, and purge cache for the entire path".
You could do so manually under Caching -> Configuration -> Custom Purge -> enter urls, or programically via the API.
About Query Strings specifically:
Under Caching -> Configuration -> Caching Level, you can configure how query strings are treated. For example:
https://domain.com/
and https://domain.com/?revalidate=1
are cached seperately with "Standard", cached together with "Ignore Query String" andwith No Query String only URLs without query strings are cachedHey, thanks for the response. Is there any way to make it so if a user visits a specific page, it revalidates the cache for another, though?
I have this so far but I am not sure where to go from here


Not in an easy way, you could do something fancy with a Cloudflare worker interacting with cache (or soon, snippets if pro or higher to avoid worker costs), but those interactions with cache are local PoP only so it wouldn't propagate to the rest of the locations