-
-
Notifications
You must be signed in to change notification settings - Fork 729
Description
When the cache-handler recevies a succesful response from one of "unsafe" http methods such as POST/PUT/DELETE... it invalidates all other cached responses to this origin.
https://github.com/nodejs/undici/blob/main/lib/handler/cache-handler.js#L79
RFC says:
A cache MUST invalidate the target URI ([Section 7.1](https://www.rfc-editor.org/rfc/rfc9110#section-7.1) of [[HTTP](https://www.rfc-editor.org/rfc/rfc9111.html#HTTP)]) when it receives a non-error status code in response to an unsafe request method (including methods whose safety is unknown).
By "target URI" here I understand the the full URL and not just an origin (correct me here if I;m wrong). For example if a client receives a succesful response for the DELETE http://example.com/foo/bar the cache hanlder can delete the GET http://example.com/foo/bar, but not all other cached responses to the http://example.com.
IMHO With a current behaviour the cache seems useless, because a one regulary called POST requests keeps your cache almost always empty.