brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: Cloudflare Development Mode bypasses the edge cache for three hours

Cache
~/tips/tip-cloudflare-development-mode-bypass-cache

cat ~/tips/tip-cloudflare-development-mode-bypass-cache.md

Development Mode switches Cloudflare's edge caching off for three hours, so changes to CSS and JS show up at once.

You change a stylesheet, reload, and still see the old one. When a site is behind Cloudflare, the edge cache is a likely suspect. Cloudflare has a switch for this moment.

In the Cloudflare dashboard, open the Configuration page of your zone and set Development Mode to on. The documentation describes it as a temporary suspension of Cloudflare’s edge caching and of Polish image optimisation. It exists so you can see changes to cacheable assets such as images, CSS and JavaScript right away.

Three things to know before you rely on it:

  • It lasts three hours, unless you turn it off sooner. For a longer bypass, the docs point to the bypass cache setting in Cache Rules.
  • It does not purge anything. Cached files stay where they are, so use the purge cache feature when you need a file gone immediately.
  • Polish is suspended as well, so images will not be optimised while it is on.

That makes it a different tool from a purge. A purge removes specific cached files once. Development Mode keeps the cache out of the way while you iterate on assets, and then you switch it off again. I’d forget about it less often if I set a reminder when turning it on, because the three hours end quietly and the cache starts working again.

If you want to see what Cloudflare does with a request, the CF-Cache-Status response header shows it. This was not tried on a live zone; everything above follows the Cloudflare documentation.

Further reading: Cloudflare Cache: Development Mode

Going deeper: Guide: your Unraid cache is full and Docker stopped, how to find out why and fix it

More Cache tips Vary: Accept-Language curl -s -o /dev/null -D – https://example.com/style.css | grep -i -E '^(cf-cache-status|age):' fincore /var/lib/example/data.db npm cache verify fc-cache -f -v ~/.local/share/fonts All Cache tips (27) All topics

Link