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

always redirect version-catchall URLs to their latest version #342

Merged
merged 2 commits into from
May 3, 2019

Conversation

QuietMisdreavus
Copy link
Member

Fixes #316 (the iteration where semver-catchall URLs were getting updated after they were cached the first time)

One of docs.rs's powerful features is the ability to provide semver requirements in lieu of actual version numbers in many places. However, when combined with a CDN that likes to cache content at certain URLs, that can cause problems when not all URLs for a certain crate are cached at the same time. For example, if you load docs.rs/tokio/0.1/tokio/index.html, it's not certain whether you'll load the index.html from 0.1.0 or 0.1.19 (the current latest version in that series), since the CDN could have cached the page from an earlier version and hasn't updated the cache since then. (Or perhaps more confusing, it has updated the cache, but only in certain regions, and not everywhere has the right version yet, which happened on a different issue.)

This PR aims to solve the problem by never serving a URL where the "version" doesn't match the actual version number of the docs it's serving. Instead it aims to issue redirects to the URL with the exact version information. This way, the URL that actually serves the content is the one that's not expected to change over time.

@QuietMisdreavus QuietMisdreavus merged commit 62680b0 into rust-lang:master May 3, 2019
@QuietMisdreavus QuietMisdreavus deleted the redirect-semver branch May 3, 2019 21:25
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.

Search does not complete
1 participant