Skip to content

fix(cloudflare): prevent unnecessary prerendering of redirect destinations#16041

Merged
matthewp merged 3 commits into
withastro:mainfrom
kylemclean:16028-fix-cf-redirect-prerender
Mar 23, 2026
Merged

fix(cloudflare): prevent unnecessary prerendering of redirect destinations#16041
matthewp merged 3 commits into
withastro:mainfrom
kylemclean:16028-fix-cf-redirect-prerender

Conversation

@kylemclean
Copy link
Copy Markdown
Contributor

Changes

Fixes #16028.

  • Fixes unnecessary prerendering of redirect destinations
  • Unnecessary files are no longer generated by static builds for redirected routes.
  • Requests are no longer made at build time to external redirect destination URLs, which could cause builds to fail.

Testing

Two tests were added to the Cloudflare package: one for an internal redirect, and one for an external redirect. Both do a test build and check that the _redirects file is properly generated and that no unnecessary requests or files were made.

Docs

No documentation changes needed, as these fixes should not affect user behavior.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 23, 2026

🦋 Changeset detected

Latest commit: 80de46b

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 Mar 23, 2026
@matthewp matthewp merged commit 56d2bde into withastro:main Mar 23, 2026
22 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Mar 23, 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.

During static build, Cloudflare adapter attempts to prerender external redirect destinations

2 participants