I have an issue with caching resources in the browser when accessing my Cloudflare domain “mywebsite.pages.dev” by itself or through the one I purchased from Namecheap, “mywebsite.xyz”. The website itself works just fine, but on reload my JS file (bundle.xxx.js) gets reloaded every time. I get " cache-control: public, max-age=0, must-revalidate" in the response header for it. Here’s how it looks in Chrome dev tools: Link. I would want it to store and reuse files from the browser cache for all my files, until I change the hash on that file. Note that the image file gets a 304 response, since Cloudflare servers sent an Etag with it on the first request.
In the overview tab it says “Great news! Cloudflare is now protecting your site”, so I think the DNS settings are all fine.
I have a page rule for mywebsite.xyz/ for “cache-everything” by the way.Also, origin cache control is on.
Maybe this is a noob question, but I really want to solve this before I start building my website.
Thanks for any help! Edit: Small text corrections.