Skip to content

fix(cloudflare): inject headers for caching the assets folder#16571

Open
MA2153 wants to merge 3 commits intowithastro:mainfrom
MA2153:fix-cf-asset-cache
Open

fix(cloudflare): inject headers for caching the assets folder#16571
MA2153 wants to merge 3 commits intowithastro:mainfrom
MA2153:fix-cf-asset-cache

Conversation

@MA2153
Copy link
Copy Markdown

@MA2153 MA2153 commented May 2, 2026

Changes

Automatically injects Cache-Control: public, max-age=31536000, immutable into Cloudflare's _headers file for hashed Astro assets (/_astro/*), skipping when build.assetsPrefix is set or when the user already has a matching Cache-Control rule.

Testing

Unit tests.

Docs

/cc @withastro/maintainers-docs for feedback!

MA2153 and others added 2 commits May 2, 2026 05:21
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 2, 2026

🦋 Changeset detected

Latest commit: 8b568f9

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added the pkg: integration Related to any renderer integration (scope) label May 2, 2026
@MA2153 MA2153 changed the title Fix cf asset cache fix(cloudflare): Inject headers for caching the assets folder May 2, 2026
@MA2153 MA2153 changed the title fix(cloudflare): Inject headers for caching the assets folder fix(cloudflare): inject headers for caching the assets folder May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: integration Related to any renderer integration (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant