-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Modify server.js to enable cache headers to be explicitly specified in tiddlywiki.info #1839
Comments
Thanks @nameanyone |
Text from GG mentioned in the OP ... Seems to be still valid
Jeremy's response ... which hasn't been implemented yet
|
@pmario @Jermolene I ran into an issue with browser caches at work, and realized it may explain some client/server weirdness that I have seen with tiddlywiki. The current advice around this is to NOT use meta tags in the head element, but to have the server set the cache-control headers directly (as Jeremy suggested). Tiddlywiki delivers the initial "package" of tiddler data inside the HTML, with no cache-control header specified. So the default "not specified" caching takes over, which is browser controlled via heuristic algorithms (unpredictable). As soon as a change is synced back to the server, the HTML in the browser cache is a race-condition-waiting-to-happen. If the page is refreshed and the tiddlers are re-loaded from the OLD cached HTML.... and then synced. Oops, just wiped out a bunch of work, didn't we? This may be important to clear up for the MWS work. I am getting back into working with TW servers, so may be able to get an idea of where to include this. Are we sill using https://www.cloudflare.com/learning/cdn/glossary/what-is-cache-control/ cache-control: no-store cache-control: no-cache An ETag is another HTTP header which contains a token unique to the version of the resource at the time it was requested. This token is changed on the origin server whenever the resource is updated. When a user returns to a page with a ‘no-cache’ resource, the client will always have to connect to the origin server and compare the ETag on the cached resource with one on the server. If the ETags are identical, the cached resource will be provided to the user. If not, this means that the resource has been updated and the client will need to download a fresh version to provide to the user. This process ensures that the user is always getting the most up-to-date version of that resource without requiring unnecessary downloads. |
Thanks @joshuafontany I've created a new issue with your comments here: #8138 |
@Jermolene I have been doing some extensive testing with the This feature satisfies all the caching concerns I could think of:
I saw a very large bandwidth reduction, and correct 304s returned to use already cached responses that match the current Etag. I also confirmed that you are NOT using state.sendResponse() in the This caching behavior (and the no-store default) should be called out in other places than just the [[Using the external JavaScript template]] tiddler. I will open a PR for that, and I consider this issue resolved. |
@Jermolene .. Can you close this issue form 2015? |
Thanks @joshuafontany @pmario |
Discussion here: https://groups.google.com/forum/#!topic/tiddlywiki/xWqZnXmYyhU
The text was updated successfully, but these errors were encountered: