Skip to content

[Workers] Document _redirects static/dynamic ordering behaviour#32083

Draft
MattieTK wants to merge 1 commit into
productionfrom
docs/redirects-static-dynamic-ordering
Draft

[Workers] Document _redirects static/dynamic ordering behaviour#32083
MattieTK wants to merge 1 commit into
productionfrom
docs/redirects-static-dynamic-ordering

Conversation

@MattieTK

Copy link
Copy Markdown
Member

Summary

Documents the existing static/dynamic classification and ordering behaviour of the _redirects file, which is currently under-specified. The file previously stated only that "static redirects should appear before dynamic redirects" without explaining the consequences.

Clarifies that:

  • A redirect is dynamic if its source contains a splat (*) or placeholder (:name); otherwise it is static.
  • Redirects are counted as static only until the first dynamic redirect. After that, every remaining redirect — including exact-path ones — counts towards the 100 dynamic-redirect limit.
  • If the dynamic limit is exceeded, the rest of the file is silently dropped from the deployment, including any catch-all at the end.

Prompted by a public report (https://x.com/samuelcolvin/status/2076993431818084700) where a large _redirects file lost everything after the dynamic-budget overflow with no build-time signal.

Related workers-sdk issue for a deploy-time warning and/or a compatibility-date-gated fix: cloudflare/workers-sdk#14694

This partial renders on both the Workers and Pages _redirects pages.

Documentation checklist

  • The change adheres to the documentation style guide.
  • If a larger change - such as adding a new page- an issue has been opened in relation to any incorrect or out of date information that this PR fixes.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/partials/workers/ @cloudflare/workers-docs, @GregBrimble, @irvinebroque, @mikenomitch, @WalshyDev, @cloudflare/deploy-config, @cloudflare/product-owners, @cloudflare/wrangler, @MattieTK, @vy-ton, @cloudflare/workers-runtime-1

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

_redirects: dynamic-rule overflow silently drops rest of file; static/dynamic classification is order-dependent and unsurfaced

5 participants