Skip to content

Commit 2fc07fe

Browse files
committed
Adjust index page Cache-Control headers
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.
1 parent a9c6b84 commit 2fc07fe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

s3_management/manage.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ def upload_libtorch_html(self) -> None:
427427
key=f"{subdir}/{self.html_name}"
428428
).put(
429429
ACL='public-read',
430-
CacheControl='no-cache,no-store,must-revalidate',
430+
CacheControl='max-age=600, public',
431431
ContentType='text/html',
432432
Body=index_html
433433
)
@@ -441,7 +441,7 @@ def upload_pep503_htmls(self) -> None:
441441
key=f"{subdir}/index.html"
442442
).put(
443443
ACL='public-read',
444-
CacheControl='no-cache,no-store,must-revalidate',
444+
CacheControl='max-age=600, public',
445445
ContentType='text/html',
446446
Body=index_html
447447
)
@@ -454,7 +454,7 @@ def upload_pep503_htmls(self) -> None:
454454
key=f"{subdir}/{compat_pkg_name}/index.html"
455455
).put(
456456
ACL='public-read',
457-
CacheControl='no-cache,no-store,must-revalidate',
457+
CacheControl='max-age=600, public',
458458
ContentType='text/html',
459459
Body=index_html
460460
)

0 commit comments

Comments
 (0)