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

Add Cache-Control to rustdoc pages #1569

Merged
merged 2 commits into from
Sep 7, 2022

Commits on Jun 22, 2022

  1. Add Cache-Control to rustdoc pages

    For /latest/ URLs, set max-age=0. For versioned URLs max-age=10 minutes
    and stale-while-revalidate=2 months.
    
    The idea behind this is that versioned URLs change mostly in minor ways
    - the "Go to latest" link at the top, and the list of versions in the
    crate menu. And setting a long cache time (either via max-age or via
    stale-while-revalidate) allows pages to be loaded even while offline.
    
    We could probably apply a long stale-while-revalidate to /latest/ URLs
    as well, but this is more likely to have a user-noticeable impact, and
    the /latest/ URLs are relatively new so we don't want to create any
    confusing interactions.
    jsha committed Jun 22, 2022
    Configuration menu
    Copy the full SHA
    a854363 View commit details
    Browse the repository at this point in the history
  2. Make Cache-Control configurable.

    jsha committed Jun 22, 2022
    Configuration menu
    Copy the full SHA
    85ed1f4 View commit details
    Browse the repository at this point in the history