2017 © Pedro Peláez
 

library guzzle-cache-handler

Guzzle 6 handler used to cache responses

image

rtheunissen/guzzle-cache-handler

Guzzle 6 handler used to cache responses

  • Monday, November 16, 2015
  • by rtheunissen
  • Repository
  • 1 Watchers
  • 11 Stars
  • 49,143 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 3 Forks
  • 2 Open issues
  • 13 Versions
  • 9 % Grown

The README.md

Guzzle handler used to cache responses

Author License Latest Version Build Status Scrutinizer Scrutinizer Coverage, (*1)

Installation

composer require rtheunissen/guzzle-cache-handler

Usage

This is a handler which caches responses for a given amount of time., (*2)

You will need an implemented CacheInterface. See rtheunissen/cache for more details., (*3)

use Concat\Http\Handler\CacheHandler;
use Doctrine\Common\Cache\FilesystemCache;
use GuzzleHttp\Client;

// Basic directory cache example
$cacheProvider = new FilesystemCache(__DIR__ . '/cache');

// Guzzle will determine an appropriate default handler if `null` is given.
$defaultHandler = null;

// Create a cache handler with a given cache provider and default handler.
$handler = new CacheHandler($cacheProvider, $defaultHandler, [

    /**
     * @var array HTTP methods that should be cached.
     */
    'methods' => ['GET', 'HEAD', 'OPTIONS'],

    /**
     * @var integer Time in seconds to cache a response for.
     */
    'expire' => 60,

    /**
     * @var callable Accepts a request and returns true if it should be cached.
     */
    'filter' => null,
]);

// Use a PSR-3 compliant logger to log when bundles are stored or fetched.
$handler->setLogger($logger);

// Create a Guzzle 6/7 client, passing the cache handler as 'handler'.
$client = new Client([
    'handler' => $handler
]);

The Versions

16/11 2015

dev-master

9999999-dev

Guzzle 6 handler used to cache responses

  Sources   Download

MIT

The Requires

 

The Development Requires

by Rudi Theunissen

cache http psr7 guzzle handler

16/11 2015

v1.1.0

1.1.0.0

Guzzle 6 handler used to cache responses

  Sources   Download

MIT

The Requires

 

The Development Requires

by Rudi Theunissen

cache http psr7 guzzle handler

11/08 2015

v1.0.1

1.0.1.0

Guzzle 6 handler used to cache responses

  Sources   Download

MIT

The Requires

 

The Development Requires

by Rudi Theunissen

cache http psr7 guzzle handler

11/08 2015

v1.0.0

1.0.0.0

Guzzle 6 handler used to cache responses

  Sources   Download

MIT

The Requires

 

The Development Requires

by Rudi Theunissen

cache http psr7 guzzle handler

26/07 2015

v0.5.0

0.5.0.0

Guzzle 6 handler used to cache responses

  Sources   Download

MIT

The Requires

 

The Development Requires

by Rudi Theunissen

cache http psr7 guzzle handler

18/06 2015

v0.4.0

0.4.0.0

Guzzle 6 handler used to cache responses

  Sources   Download

MIT

The Requires

 

The Development Requires

by Rudi Theunissen

cache http psr7 guzzle handler

14/06 2015

v0.3.2

0.3.2.0

Guzzle handler used to cache responses

  Sources   Download

MIT

The Requires

 

The Development Requires

by Rudi Theunissen

14/06 2015

v0.3.1

0.3.1.0

Guzzle handler used to cache responses

  Sources   Download

MIT

The Requires

 

The Development Requires

by Rudi Theunissen

13/06 2015

v0.3.0

0.3.0.0

Guzzle handler used to cache responses

  Sources   Download

MIT

The Requires

 

The Development Requires

by Rudi Theunissen

06/06 2015

v0.2.0

0.2.0.0

Guzzle handler used to cache responses

  Sources   Download

MIT

The Requires

 

The Development Requires

by Rudi Theunissen

05/06 2015

v0.1.0

0.1.0.0

Guzzle handler used to cache responses

  Sources   Download

MIT

The Requires

 

The Development Requires

by Rudi Theunissen

05/06 2015

v0.0.2

0.0.2.0

Guzzle handler used to cache responses

  Sources   Download

MIT

The Requires

 

The Development Requires

by Rudi Theunissen

05/06 2015

v0.0.1

0.0.1.0

Guzzle handler used to cache responses

  Sources   Download

MIT

The Requires

 

The Development Requires

by Rudi Theunissen