Open DavidSint opened 2 years ago
This nuance is not implemented in this library.
If you'd like to make a pr for this, I think I'd be fine to add it. I assume it can be implemented without changes to the library's API, and if a cached response has the named header then simply report it needs revalidation.
The cache control RFC states in section 5.2.2.2:
Specifically, from what I have seen, if a
no-cache
value appears in theCache-Control
header then it does not appear to be cached, even if theno-cache
value specifies a header field. There is an opportunity to abide by the MAY clause in the spec, where the response can still be cached (except for the specified field(s)).For example, if we see
no-cache: set-cookie
it is possible, according to the spec, that the response can be cached EXCEPT forSet-Cookie
header(s).I'm opening this issue to look into whether this part of the spec can be implemented in the library so that the response can still be cached.