Cloudflare Pages subdomain cache


This post goes over how to handle Cloudflare Pages subdomain cache.

Subdomain

To set up a subdomain for a Cloudflare Pages site, add a CNAME record.

Pages’s default caching beahvior:

Pages comes with built in caching defaults that are optimized for caching as much as possible, while providing the most up to date content. Every time you deploy an asset to Pages, the asset remains cached on the Cloudflare CDN until your next deployment. Therefore, you should avoid setting Page Rules or custom caching on your site.

Proxied

If the Proxy status is Proxied or orange-clouded, then Cloudflare also caches your site on the Edge Cache.

To bypass cache, create a Page Rule or Cache Rule.

DNS only

To prevent double caching, set the Proxy status to DNS only so requests go straight to the origin server.

Another benefit of opting out of proxy is that the response times are faster since you save a redirect.



Please support this site and join our Discord!