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
Noah;
Noah;OP5mo ago
How do I do this? I cant find anything under Cache Rules to revalidate a page
Chaika
Chaika5mo ago
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 cached
Noah;
Noah;OP5mo ago
Hey, 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?
Noah;
Noah;OP5mo ago
I have this so far but I am not sure where to go from here
No description
No description
Chaika
Chaika5mo ago
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

Did you find this page helpful?