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

Use browser caching to eliminate duplicate file downloads #108

Open
billyc opened this issue Feb 13, 2019 · 0 comments
Open

Use browser caching to eliminate duplicate file downloads #108

billyc opened this issue Feb 13, 2019 · 0 comments
Assignees
Labels
feature New feature or request on-hold

Comments

@billyc
Copy link
Collaborator

billyc commented Feb 13, 2019

Datasette does something really cool: they

  • (1) append a hash to every URL, which changes if the file changes, and
  • (2) if you request a file without a hash (which is the normal use case), an HTTP 302 redirect always redirects you to the URL with the latest hash
  • (3) and that response has a far-future "HTTP cache expiry header"

This way the browser only needs to download a file once and it then retrieved from cache for all subsequent requests. That is, until the file gets changed! Then the hash redirect forces an update. Pretty slick!

See https://simonwillison.net/2018/Oct/4/datasette-ideas/#Farfuture_cache_expiration

Can we do this??!?

@billyc billyc added the feature New feature or request label Feb 13, 2019
@billyc billyc added this to the m1 milestone Feb 13, 2019
@billyc billyc modified the milestones: m1, m2 Feb 13, 2019
@billyc billyc modified the milestones: m2, m4 Sep 10, 2019
@billyc billyc added the on-hold label Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request on-hold
Projects
None yet
Development

No branches or pull requests

2 participants