Class Guzzle\Plugin\Cache\DefaultCacheStorage

InheritanceGuzzle\Plugin\Cache\DefaultCacheStorage
ImplementsGuzzle\Plugin\Cache\CacheStorageInterface

Default cache storage implementation

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
getBodyKey() Create a cache key for a response's body Guzzle\Plugin\Cache\DefaultCacheStorage
getCacheKey() Hash a request URL into a string that returns cache metadata Guzzle\Plugin\Cache\DefaultCacheStorage

Property Details

$cache protected property

Cache used to store cache data

$defaultTtl protected property

Default cache TTL

protected int $defaultTtl null
$keyPrefix protected property
protected string $keyPrefix null

Method Details

__construct() public method

public void __construct ( $cache, $keyPrefix '', $defaultTtl 3600 )
$cache mixed

Cache used to store cache data

$keyPrefix string

Provide an optional key prefix to prefix on all cache keys

$defaultTtl int

Default cache TTL

cache() public method

public void cache ( Guzzle\Http\Message\RequestInterface $request, Guzzle\Http\Message\Response $response )
$request
$response
delete() public method

public void delete ( Guzzle\Http\Message\RequestInterface $request )
$request
fetch() public method

public void fetch ( Guzzle\Http\Message\RequestInterface $request )
$request
getBodyKey() protected method

Create a cache key for a response's body

protected string getBodyKey ( $url, Guzzle\Http\EntityBodyInterface $body )
$url string

URL of the entry

$body Guzzle\Http\EntityBodyInterface

Response body

getCacheKey() protected method

Hash a request URL into a string that returns cache metadata

protected string getCacheKey ( Guzzle\Http\Message\RequestInterface $request )
$request Guzzle\Http\Message\RequestInterface
purge() public method

public void purge ( $url )
$url