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

Extend cache-control's max-age for main.HASH.js #307

Open
PGijsbers opened this issue May 22, 2023 · 0 comments
Open

Extend cache-control's max-age for main.HASH.js #307

PGijsbers opened this issue May 22, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@PGijsbers
Copy link
Contributor

It looks like we use URL-based caching for the main javascript file, based on the fact that the name contains a hash and the HTTP header contains a set max-age:

C:\Users\Pieter>curl  -I https://www.openml.org/static/js/main.27ea998a.js
HTTP/1.1 200 OK
Date: Mon, 22 May 2023 20:58:21 GMT
Server: gunicorn/20.0.4
Content-Length: 2130393
Content-Type: application/javascript; charset=utf-8
Last-Modified: Wed, 03 May 2023 17:30:58 GMT
Cache-Control: public, max-age=43200
Expires: Tue, 23 May 2023 08:58:21 GMT
ETag: "1683135058.0947442-2130393-3808763291"
Accept-Ranges: bytes
Access-Control-Allow-Origin: *

Why then is the max-age only set to 12 hours? It is my understanding that with this setup, invalidation should happen by updating the HTML page to reference a different javascript file. The max-age can then be set to something much larger (a month or year), so that conceivably there is never a cache validation round trip explicitly for the javascript file.
Updating the max-age will result in viewer round trips which lightens server load and gives the user a faster experience.

@PGijsbers PGijsbers added the enhancement New feature or request label May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant