guzzle-cache-middleware
guzzle-cache-middleware copied to clipboard
Writes empty files when using sink
Whenever I use this middleware when combined with the sink
option empty files are written:
$client->get($uri, ['sink' => "$dir/$uri"]);
The file $dir/$uri
is created but has no content.
Are you sure that this is this middleware that cause the issue?
The sink
option is handled before this middleware.
Can you share/post your code?
Yes, I've confirmed that sink
works correctly when this middleware is disabled.
Guzzle config is here and here is our calling code, which is currently not using sink
due to this issue.
We're also seeing this issue in this project. The workaround of not using sink
(and instead writing the response body out to a file after the Guzzle request) seems to work fine.