Astro Info
Astro v6.3.1
Vite v7.3.3
Node v25.9.0
System Linux (x64)
Package Manager npm
Output static
Adapter @astrojs/cloudflare (v13.5.0)
Integrations @astrojs/mdx (v5.0.4)
@astrojs/sitemap (v3.7.2)
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When deploying an Astro site to Cloudflare Pages or Workers, the hashed static assets under /_astro/* (JavaScript bundles, CSS, images, and other build outputs) are served with a Cache-Control: public, max-age=0, must-revalidate header. This forces the browser to revalidate every asset with the server before each use — meaning every page load requires round-trips to confirm that fonts, scripts, stylesheets, and other resources are still current, even though their content-addressed URLs guarantee they are unchanged.
What's the expected result?
A Cache-Control: public, max-age=31536000, immutable header would be present to allow long-term caching of Astro assets, which is the intended behavior.
Link to Minimal Reproducible Example
https://github.com/MA2153/astro-assets-cf-repro
Participation
Other Info
Here is the live website: https://astro-assets-cf-repro.ma2153.workers.dev
Here is the full AI summary of the bug: https://github.com/MA2153/astro-assets-cf-repro/blob/main/README.md
PR is #16571
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When deploying an Astro site to Cloudflare Pages or Workers, the hashed static assets under
/_astro/*(JavaScript bundles, CSS, images, and other build outputs) are served with aCache-Control: public, max-age=0, must-revalidateheader. This forces the browser to revalidate every asset with the server before each use — meaning every page load requires round-trips to confirm that fonts, scripts, stylesheets, and other resources are still current, even though their content-addressed URLs guarantee they are unchanged.What's the expected result?
A
Cache-Control: public, max-age=31536000, immutableheader would be present to allow long-term caching of Astro assets, which is the intended behavior.Link to Minimal Reproducible Example
https://github.com/MA2153/astro-assets-cf-repro
Participation
Other Info
Here is the live website: https://astro-assets-cf-repro.ma2153.workers.dev
Here is the full AI summary of the bug: https://github.com/MA2153/astro-assets-cf-repro/blob/main/README.md
PR is #16571