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

Adjust index page Cache-Control headers #6188

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

edmorley
Copy link

@edmorley edmorley commented Jan 18, 2025

This changes the Cache-Control value for index pages from:
no-cache,no-store,must-revalidate

...to:
max-age=600, public

In order to allow the pages to be cached for up to 10 minutes.

The new value was chosen so that it matches that returned for PyPI index pages:

$ curl -sSI https://pypi.org/simple/ | rg cache-control
cache-control: max-age=600, public

For explanations of the directives, see:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#response_directives

Fixes pytorch/pytorch#130571.

This changes the `Cache-Control` value for index pages from:
`no-cache,no-store,must-revalidate`

...to:
`max-age=600, public`

In order to allow the pages to be cached for up to 10 minutes.

The new value was chosen so that it matches that returned for
PyPI index pages:

```
$ curl -sSI https://pypi.org/simple/ | rg cache-control
cache-control: max-age=600, public
```

For explanations of the directives, see:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#response_directives

Fixes #pytorch/pytorch#130571.
Copy link

vercel bot commented Jan 18, 2025

@edmorley is attempting to deploy a commit to the Meta Open Source Team on Vercel.

A member of the Team first needs to authorize it.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 18, 2025
s3_management/manage.py Outdated Show resolved Hide resolved
s3_management/manage.py Outdated Show resolved Hide resolved
s3_management/manage.py Outdated Show resolved Hide resolved
@atalman
Copy link
Contributor

atalman commented Jan 20, 2025

Hi @edmorley Looks good. lets also keep explicit must-revalidate after max-age=600 is reached

Add back `must-revalidate`

Co-authored-by: Andrey Talman <atalman@fb.com>
@edmorley edmorley requested a review from atalman January 22, 2025 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Responses from https://download.pytorch.org/whl/cpu have cache-control: no-cache set in their headers
3 participants