guzzle-cache-middleware icon indicating copy to clipboard operation
guzzle-cache-middleware copied to clipboard

Apply stale-while-revalidate also for responses without a validator

Open pilif opened this issue 3 months ago • 1 comments

this is an updated version of #128, rebased on top of current HEAD and with a fix to the test to reflect the new reality (which is what #128 was waiting on for 2 years).

This is super useful when talking to a server outside of the caller's control if a stale response is always preferable to no response and if the server is living in the past and providing no useful cache validation feature.

In this case, a stale response can still be served from cache while a full download happens in the background

pilif avatar Aug 25 '25 11:08 pilif