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

Increase cache TTL for assets #3

Open
strogonoff opened this issue Jul 13, 2020 · 0 comments
Open

Increase cache TTL for assets #3

strogonoff opened this issue Jul 13, 2020 · 0 comments
Assignees

Comments

@strogonoff
Copy link
Contributor

strogonoff commented Jul 13, 2020

Since our frontend build now adds unique hashes to filenames, it is OK to let browsers cache most assets for a long time even if we iterate quickly and push out new website versions quite often.

We could make our website load faster this way.

Which assets this applies to

The following assets can be allowed to be cached (either by path prefix or file extension):

  • File extensions — *.js, *.ttf, *.svg
  • Paths (relative to glossarist.org site root) — /static/*, /templates/*

There is a high degree of certainty that any asset under those paths or with those file extensions will remain to be handled by website build process.

Unless I am mistaken, TTL seems to be None for those.

Where this does not apply

Below are examples of where we do not want to set TTL too long. These files do not have filename extensions and do not reside under global path prefixes mentioned above, so setting high TTL as described in previous section should not hurt these, but just for the record:

  • index.html (obviously) and adjacent routeInfo.json files do not have hashes in their filenames.

  • *.json files under /_in_app_help/ global path prefix do not have hashes in their filenames and might change. Those .json files are intended for consumption by desktop app’s built-in help as a kind of API, their TTL should be a couple of days at most perhaps?

  • Documentation page illustrations. Those files (so far only .pngs) are currently copied adjacent to respective index.html files that reference them. Not expected to change, generally, but do not have hashes in filenames.

Reference

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

No branches or pull requests

2 participants