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

No guzzle delay if cached

Open gmmedia opened this issue 6 years ago • 1 comments

Hallo, I use a delay in the guzzle config to avoid 429 Too Many Requests errors.

    $config = [
        'handler' => $stack,
        'delay' => 700,
    ];

That delay is not necessary if the file cache is used.

Is it possible to use no delay if the guzzle-cache-middleware returns the cached file?

thanks Jochen

gmmedia avatar Sep 26 '18 13:09 gmmedia

Hi, Are you sure that the delay impact the response from the cache? I looked into the source of Guzzle and I thought that it only delay the real call to the network. => https://github.com/guzzle/guzzle/blob/003757426cdd50fbad1c34cdbcc8a55f70a4fe8b/src/Handler/CurlHandler.php#L36

Kevinrob avatar Apr 15 '19 13:04 Kevinrob