Server side caching for Guzzle 4/5

1.0.0 2015-02-27 00:05 UTC

This package is auto-updated.

Last update: 2021-11-28 00:45:32 UTC


Build Status SensioLabs Insight Coverage Status Scrutinizer Code Quality Total Downloads

Server side caching (based on doctrine/cache) for Guzzle 4/5.

Server side caching helps to improve performances intercepting cached requests before these are sent to the URL (save network usage), and caching (when possible and permitted) responses.

API: emanueleminotto.github.io/guzzle-cache-subscriber


Install the CacheSubscriber adding emanueleminotto/guzzle-cache-subscriber to your composer.json or from CLI:

$ composer require emanueleminotto/guzzle-cache-subscriber


use GuzzleHttp\Client;
use EmanueleMinotto\Guzzle\CacheSubscriber;

$client = new Client();

$subscriber = new CacheSubscriber(/* Doctrine cache instance, optional */);
// there are the getCache and setCache methods to
// change the storage system


// request sent

// request intercepted