Skip to content

Commit 59d6334

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 501b943 commit 59d6334

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
@@ -434,7 +434,7 @@ def upload_libtorch_html(self) -> None:
434434
key=f"{subdir}/{self.html_name}"
435435
).put(
436436
ACL='public-read',
437-
CacheControl='no-cache,no-store,must-revalidate',
437+
CacheControl='max-age=600, public',
438438
ContentType='text/html',
439439
Body=index_html
440440
)
@@ -448,7 +448,7 @@ def upload_pep503_htmls(self) -> None:
448448
key=f"{subdir}/index.html"
449449
).put(
450450
ACL='public-read',
451-
CacheControl='no-cache,no-store,must-revalidate',
451+
CacheControl='max-age=600, public',
452452
ContentType='text/html',
453453
Body=index_html
454454
)
@@ -461,7 +461,7 @@ def upload_pep503_htmls(self) -> None:
461461
key=f"{subdir}/{compat_pkg_name}/index.html"
462462
).put(
463463
ACL='public-read',
464-
CacheControl='no-cache,no-store,must-revalidate',
464+
CacheControl='max-age=600, public',
465465
ContentType='text/html',
466466
Body=index_html
467467
)

0 commit comments

Comments
 (0)