Cloudflare cache serving outdated page

Hello,

I've been running my site on cloudflare pages for a few months now, and recently I have started noticing an odd issue.

The cloudflare cache appears to sometimes cache the pages HTML file, and does not update when a new deploy happens.

Specifically, it caches the html page. The I deploy a new version of the site and the path to the stylesheet changes. Cloudflare still serves the old html with the link to the old stylesheet, but it does not exist anymore, leading to the page having messed up styles.

For now I've added a cache rule on the site to exclude the apex from caching. Is there a better way to do this?
Was this page helpful?