Implementation Help?


I’m not an expert on “cache everything” but I can explain what my code does which should be completely independent of any other cache settings. For the HTML it caches it rewrites the cache headers to make it cache for a year (just locally). When it is sent to the browser it puts the original headers back. My script should edge-cache the HTML independently of any Cloudflare settings or the headers that are passed back to the browser.


Good to know.

It sounds like you set a really high Edge Cache time, but will purge it if it’s been modified?

How long will it really stay in that edge cache if the page hasn’t been modified?

And your worker will override any funky stuff I do with Page Rules and W3TC?


Yes, it is cached as long as possible and then when an update happens the cache is purged. As for how long it ACTUALLY stays in cache, that is going to depend on how frequently it is accessed and how busy the edge is. If it isn’t accessed for several days I’d bet it will get automatically aged out of the cache independently of the cache settings.

Think of the worker as a layer in front of everything else. The page rules and W3TC will still run on the requests that aren’t served from the worker cache.


Thanks. My last question…in two parts…

Is the Workers cache separate from the regular edge cache? Does the “Purge Everything” button clear the Workers cache?


Sort of. The cache itself is separate and resources in the worker cache are independent of the regular cache when accessing them (or accessing the regular cache) but the global “purge all” does also purge the worker caches.

If the worker edge cache doesn’t automatically purge for some reason (like you changed a file manually on the server) then a purge all through the UI will also clear the worker cache.