Open
Description
There are multiple caching strategies we can try. I'd propose we start with the simplest, which could look like this:
- You get the modification date of the underlying s3 file
- Make sure you send that date in a
Last-Modified
header - You may also get a
if-modified-since
header. If so, compare and:Last-Modified > if-modified-since
- exit with 304 status code without doing anything else.Last-Modified <= if-modified-since
- Continue with the queries as usual
Notes:
- If you send Last-Modified you should get back if-modified-since in the follow up requests. Otherwise it may not be present.
- The actual storage in this case happens in browsers.
- Browsers have mechanisms to clear the cache or to bypass it by force reloading (like Cmd+Shift+R on Mac)
- If this is not good enough (if the file modification timestamp is not the only variable we need to account for) we can switch to
ETag
caching which is very similar - See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Last-Modified and https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Modified-Since
Metadata
Metadata
Assignees
Labels
No labels