Skip to content
This repository has been archived by the owner on Oct 14, 2019. It is now read-only.

Make sure website files can expire in a timely way so users always get the latest version of the website #207

Open
rickles42 opened this issue Jul 25, 2018 · 1 comment
Labels
enhancement New feature or request

Comments

@rickles42
Copy link
Contributor

Currently users may have to F5 or Ctrl+F5 in order to force their browsers to request the latest version of the website after we deploy changes. We should add expiration headers or something so that browsers check for updated files more frequently.

@rickles42 rickles42 added the enhancement New feature or request label Jul 25, 2018
@robalb
Copy link
Contributor

robalb commented Jul 27, 2018

To activate browser caching, there are basically three methods:

  • Cache-Control
  • Expires
  • Etag

Expires contains the date after which the response is considered stale, but is obsolete.
Cache-Control tells a browser how long to use its local copy of a resource before getting it from the server again.
Etag is an identifier for a specific version of a resource, the idea is that if the identifier of the resource is the same as the one the browser has already in cache, it won't download it again.
If the resource changes, a new Etag value must be generated.
Etag is the method enabled on our server:
if you look at the response headers, for example at the resource path
https://memes.market/css/index.css you'll find the header etag "pbkl511av"
For some reasons the etags of these static resources are not regenerated when the resource is modified, but i'm not sure about how the etags are handled, or if the etags are actually regenerated and it's the browser that doesn't update the resources for some reason.
We should probably make some tests by updating some resources and analyzing the response headers before and after the update, and how the browser handles them

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants