-
Notifications
You must be signed in to change notification settings - Fork 46
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
Caching headers #74
Comments
http://security.stackexchange.com/a/7008/31246 - set |
Turns out there is some caching:
[http://www.webpagetest.org/result/150220_21_CGX/] There are basically 2 kinds of caching:
Relevant headers in our response from RHcloud-hosted mathdown.net (on codemirror.js):
The last-modified time here is matches the file date (verified via ssh into rhcloud & heroku run):
The etag is generated based on the dev, ino, and last modified date. Stat results are cached. |
I actually want to get rid of max-age — for 10min after each deploy it may cause unpredictable bugs due to mixed versions. |
During developement, changing a file still serves the old file for a short time (minute?), even with Shift+refresh. |
As part of #172 I moved to Netlify, which does something sensible as a CDN, and I no longer care what exactly 👓 |
GH Pages sends
Cache-Control:max-age=600
header (and correspondingExpires
in 10minutes).http://www.webpagetest.org/performance_optimization.php?test=150216_4T_H0J&run=1&cached=0
Also it was served via Fastly CDN.
Heroku and RHcloud [http://www.webpagetest.org/result/150216_TV_HNP/, http://www.webpagetest.org/result/150216_CH_HP2/] also set 10 minutes.
So at least I'm not worse off...
Background reading: http://tomayko.com/writings/things-caches-do
I see 3 approaches:
This is hard to do with dev/prod parity — if index.html from checkout works, then dynamic server must rewrite links? Also, unless every single file changes (which requires more extensive rewriting) this may end up caching less than stable URL + ETag.
Oh, should also read up cache manifests (or is that only for browser extensions?).
The text was updated successfully, but these errors were encountered: