When purging cache (happens for both Purge via Dashboard & purge via API) the request which is served by Cloudflare Worker still contains cached content (i.e. cache doesn’t get purged)
The Worker is supposed to send a prerendered version based on user agent, it does not alter any cache keys.
However, when fetching URL normally, the resource shows that the cache was purged, Cache-Status: MISS.
There has to be something else going on in order to not serve the same cached version for googlebot as for regular visitors. How is your worker handling this?
#10 overrides #9 by saying cache if user agent contains “google”
the purge request you send acts just like the fetch request your worker normally sends. When you send a purge request for https://service.prerender.io/https://germantechjobs.de/jobs/Cisco/all for example, nothing gets purged because the cache rule triggers and says cache is being bypassed so nothing would exist to be purged.
What you need to do is trigger the same features/path that the fetch/GET does so in order to purge the googlebot version, in the purge request you send, you need to include a user-agent that contains “google”
To be honest, the default caching behavior of Cloudflare is counterintuitive to say the least.
Why does it apply all the edge cases to the cache keys, instead of using just the URL itself as the key?
There should be a setting that enables it.
I don’t see a reason why (in our Zone) the URL xyz is cached differently depending on user agents, referrers, and the worker itself. If I want to cache xyz, then I want just that and if I want to purge it, I should be able to calle purge xyz in order to purge it from all cases.
First of all, happy fourth anniversary of you joining the Community!
If that happened, and Google crawled your site first, then all your users will end up seeing a cached view of whatever Google got from Prerender.
For the same reason above, but in the opposite direction. If you want a special version of the cache, you’re going to have to purge the special version of the cache. If all the Prerender URLs are bad, but the rest are fine, many aren’t going to want to wipe out all the good stuff just to get rid of the bad stuff.
For non-Enterprise plans, there’s Purge URL (cache-key), and Purge Everything. Enterprise gets more options, because $$$.