-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Description
I have the following scenario:
GET
some url, returns a cacheable (for couple seconds) result with proper headersGET
same url within cached timeframe, does not hit the server, returns response directly from cache (great)GET
same url when cache has expire, sends the request to server, server respond with a304
no-cache
.- Middleware trace is
valid, store
, meaning it re-stored the original response back into cache store (great) GET
same url within cached timeframe, should not hit the server but it actually re-validate the response.
Why is that? Since the last validate
, the server respond with a 304
and the gem re-stored the response into the cache store. It should be able to pickup the cached response directly, at least while the cache entry is still fresh.
I think the issue is that when the gem ask if the entry is fresh here it's based on the max-age
which is nil
since it was a 304
with no-cache
.
But correct me if I'm wrong, the no-cache
statement is just for the 304
request, because you don't want to cache a 304
since it has empty body, but it does not mean you should not re-store the original response right?
Hope what I wrote is understandable..
Thanks!
Metadata
Metadata
Assignees
Labels
No labels