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

Update static files cache TTL #35

Merged
merged 1 commit into from
Nov 18, 2020

Conversation

tbille
Copy link
Contributor

@tbille tbille commented Nov 18, 2020

Update default cache control header for static files to a year.

https://flask.palletsprojects.com/en/1.1.x/config/#SEND_FILE_MAX_AGE_DEFAULT

Copy link
Contributor

@jkfran jkfran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jkfran
Copy link
Contributor

jkfran commented Nov 18, 2020

Toto, what are the motivations for this change?

@tbille
Copy link
Contributor Author

tbille commented Nov 18, 2020

@jkfran static content can be cached for ever, we have a hash that would show if there is an update. This will avoid requesting too often the same assets from the same browser.

eg. https://charmhub.io/static/js/dist/base.js?v=4dd35c4

@jkfran
Copy link
Contributor

jkfran commented Nov 18, 2020

@jkfran static content can be cached for ever, we have a hash that would show if there is an update. This will avoid requesting too often the same assets from the same browser.

eg. https://charmhub.io/static/js/dist/base.js?v=4dd35c4

It's what I was thinking! Cool! I'm wondering if caching all the static files and their versions for a long time could cause a space problem for IS

@jkfran jkfran merged commit 232cbeb into canonical:master Nov 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants