Goutte disable Gzzle caching
I have a problem with Goutte, or is it actually Guzzle part of Goutte.
Guzzle automatically caches every GET call, I tried to disable it but I can't get it to work.
As you can see here, I am parsing the cache parameters directly in the Guzzle constructor.
use Goutte\Client;
use Guzzle\Http\Client as GuzzleClient;
$client = new Client();
$client->setClient(new GuzzleClient('/', array(
'curl.options' => array(
CURLOPT_COOKIESESSION => true,
CURLOPT_COOKIEJAR => 'cookie.txt',
CURLOPT_FRESH_CONNECT => true,
CURLOPT_TIMEOUT => 0
),
'params.cache.override_ttl' => 0,
'params.cache.default_ttl' => 0,
'params.cache.revalidate' => 'always'
)));
However, this does not make any changes. As for the documentation for the cacheplugin (see: http://guzzlephp.org/guide/http/caching.html )
This code:
echo $client->getClient()->get('/')->getParams()->get('cache.override_ttl');
Should output the current value of cache.override_ttl, this should output nothing.
I believe it must be something about the Goutte shell that I am missing. Does anyone have any idea?
+3
source to share
No one has answered this question yet
Check out similar questions: