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.
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/barthe cache hanlder can delete theGET http://example.com/foo/bar, but not all other cached responses to thehttp://example.com.IMHO With a current behaviour the cache seems useless, because a one regulary called POST requests keeps your cache almost always empty.