Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send invalidations for index.crates.io when updating crates #4913

Closed
arlosi opened this issue Jun 22, 2022 · 2 comments · Fixed by #5200
Closed

Send invalidations for index.crates.io when updating crates #4913

arlosi opened this issue Jun 22, 2022 · 2 comments · Fixed by #5200
Labels
A-backend ⚙️ C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works

Comments

@arlosi
Copy link
Contributor

arlosi commented Jun 22, 2022

The HTTP index (index.crates.io) currently has a TTL of 10 minutes and does not send invalidations when publishing new crates. Users may need to wait up to 10 minutes after publishing a crate for it to be visible in the HTTP index.

If we sent invalidations to CloudFront when a crate was updated, we could increase the TTL (for better caching), and users would see updates sooner.

@alexcrichton
Copy link
Member

To expand on my rationale for asking about this, I find this pretty crucial when publishing graph of crates all at once for the time being. When publishing a binary, even with --no-verify which doesn't compile anything, Cargo will (IIRC) generate a fresh Cargo.lock to get embedded into the *.crate file in case cargo install --locked is used. In this situation though the crates the binary depends on, if they live in the same repository, may not exist on crates.io yet. This round-trip time also naturally takes longer the deeper the dependency graph (although the deep case largely only matters for publishes that verify each step since otherwise the binary is typically only at the end).

Effectively I think a 10 minute TTL will make publishing a graph of crates infeasible. It's always possible for Cargo to use the git index on cargo publish, though (or perhaps with an opt-in).

@Eh2406
Copy link
Contributor

Eh2406 commented Jun 22, 2022

That is a known issue. 10 minutes is not acceptable. Thanks for bringing this to our attention!
When we have invalidations the ttl should be way longer than 10 minutes, probably one day.
Before we have invalidations the ttl should be like 1 min. I will make a PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backend ⚙️ C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants