Skip to content

doc.rust-lang.org: add caching headers for static content #82286

@jsha

Description

@jsha

Steps to reproduce:

  1. Load any doc.rust-lang.org page, e.g. https://doc.rust-lang.org/std/str/index.html.
  2. Open Developer Console.
  3. Click the URL bar and hit enter to load the page again.

Expected result:

Most resources are cached and do not hit the network.

Actual result:

Many objects require a network fetch, but get a 304 Not Modified. These should be served with long caching headers.

image

Current headers:

$ curl -I https://doc.rust-lang.org/SourceCodePro-Regular.woff
HTTP/2 200 
content-type: font/woff
content-length: 55472
last-modified: Thu, 11 Feb 2021 14:27:46 GMT
x-amz-version-id: R.xOjlR7eKEsQwzm9EIrHs9eeCIDeXYq
server: AmazonS3
date: Thu, 18 Feb 2021 13:27:31 GMT
etag: "957fa8c030f8116bea59c13df470e4e8"
x-cache: Hit from cloudfront
via: 1.1 4b84530d7a095b58fb7a1d20b7f0cbe0.cloudfront.net (CloudFront)
x-amz-cf-pop: HIO50-C2
x-amz-cf-id: QpMYsW6BVcTPpDmi8Pg9HiMz_1iSOIpdYv60MMzNqVoV707yqsv_Dw==
age: 63023

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions