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

Set max age of cache #2509

Open
bmorelli25 opened this issue Aug 30, 2022 · 0 comments
Open

Set max age of cache #2509

bmorelli25 opened this issue Aug 30, 2022 · 0 comments

Comments

@bmorelli25
Copy link
Member

Summary

We don't set a max age for cached website assets. This is problematic for certain updates, like #2478, that change the appearance or functionality of the docs. After the update, many users reported a weird half-new/half-old version of the site that could only be fixed with a hard refresh of the page.

One solution would be to use the Cache-Control max age directive. The example below tells the browser that it can use a cached file for one week without having to revalidate it. After one week, the browser will revalidate the file and download a new file if it exists.

Cache-Control: max-age=604800

I'm new to this topic so if I'm wrong, let me know :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant