Right now, even though Publ correctly sets ETag headers to avoid needing to redownload things, there's no cache-control headers, so the browser still has to do the whole If-None-Match flow. Unfortunately this often leads to a Flash of Unstyled Content (FOUC) especially when stylesheets get a bit more complex or nested.
Once upon a time, Publ would set cache-control headers on responses to match the cache timeout values. This should probably be brought back.
Possible Solution
Ideally, the cache-control header should not be set for requests that access the user property, since that can lead to unexpected caching behavior when people log in or out.
So, for requests that access user (either from checking the user object or checking e.g. entry authentication), the response header should be
Expected Behavior
Right now, even though Publ correctly sets ETag headers to avoid needing to redownload things, there's no cache-control headers, so the browser still has to do the whole
If-None-Match
flow. Unfortunately this often leads to a Flash of Unstyled Content (FOUC) especially when stylesheets get a bit more complex or nested.Once upon a time, Publ would set cache-control headers on responses to match the cache timeout values. This should probably be brought back.
Possible Solution
Ideally, the cache-control header should not be set for requests that access the
user
property, since that can lead to unexpected caching behavior when people log in or out.So, for requests that access
user
(either from checking the user object or checking e.g. entry authentication), the response header should beand for templates that do not, it should be
Access to the user object can be tracked in the
flask.g
stash.Steps to Reproduce (for bugs)
1. 2. 3. 4.
Context