How and for how long do browsers store Etags?
I wish to implement etag based cache-control, and I am wondering how long
Etags are stored in a browser and if they can be kept for longer than the
current session.
I have the server setting and sending etags for responses correctly, and I
am sending requests from the browser with jQuery.ajax.
The system works correctly, responding with the appropriate 304 response
if the Not-Modified header (previous etag) matches the generated etag on
the server. This all works fine for the current session, however when I
close the browser and reopen it, the Not-Modified header is not being sent
by jQuery any more.
I am wondering if there are any methods I could use to trigger the default
browser behaviour, and send the Not-Modified header for responses (if
applicable), without manually setting the header in the ajax request or
storing the etag in localStorage/indexedDb.
No comments:
Post a Comment