Skip to content

crates.io: Resolve static asset URLs at the Fastly edge - #1235

Merged
ubiratansoares merged 1 commit into
rust-lang:masterfrom
Turbo87:cdn-redirects
Sep 17, 2026
Merged

ubiratansoares merged 1 commit into
rust-lang:masterfrom
Turbo87:cdn-redirects

Conversation

@Turbo87

@Turbo87 Turbo87 commented Sep 15, 2026

Copy link
Copy Markdown
Member

Matching GET and HEAD requests for crate downloads and READMEs now resolve to static.crates.io without contacting Heroku. Fastly returns a redirect by default and a JSON URL when Accept requests JSON.


Disclaimer: This was written by Codex (GPT-6 Astra), and due to missing infra access I could not verify if this actually works as intended.

@ubiratansoares

Copy link
Copy Markdown
Contributor

terragrunt plan looks good, I'll deploy these changes to staging first and give them a manual try.

@ubiratansoares ubiratansoares self-assigned this Sep 16, 2026
@Turbo87

Turbo87 commented Sep 16, 2026

Copy link
Copy Markdown
Member Author

I'll deploy these changes to staging first and give them a manual try

I just ran a quick manual test and things seems to be working as intended on staging, while production still routes to Heroku for now.

@ubiratansoares ubiratansoares left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found two things, partially assisted by Claude Code

Comment thread terragrunt/modules/crates-io/vcl/static-redirect-recv.vcl Outdated
Comment thread terragrunt/modules/crates-io/vcl/static-redirect-error.vcl.tftpl Outdated
Matching `GET` and `HEAD` requests for crate downloads and READMEs now resolve to `static.crates.io` without contacting Heroku. Fastly returns a redirect by default and a JSON URL when `Accept` requests JSON.

@ubiratansoares ubiratansoares left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied this to prod.

@ubiratansoares
ubiratansoares merged commit 05bf425 into rust-lang:master Sep 17, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants