\Guzzle\Plugin\CacheDefaultCacheStorage

Default cache storage implementation

Summary

Methods
Properties
Constants
__construct()
cache()
delete()
purge()
fetch()
No public properties found
No constants found
getCacheKey()
getBodyKey()
$keyPrefix
$cache
$defaultTtl
N/A
requestsMatch()
persistHeaders()
No private properties found
N/A

Properties

$keyPrefix

$keyPrefix : string

Type

string

$defaultTtl

$defaultTtl : integer

Type

integer — Default cache TTL

Methods

__construct()

__construct(mixed  $cache, string  $keyPrefix = '', integer  $defaultTtl = 3600) 

Parameters

mixed $cache

Cache used to store cache data

string $keyPrefix

Provide an optional key prefix to prefix on all cache keys

integer $defaultTtl

Default cache TTL

delete()

delete(\Guzzle\Http\Message\RequestInterface  $request) 

Deletes cache entries that match a request

Parameters

\Guzzle\Http\Message\RequestInterface $request

Request to delete from cache

purge()

purge(string  $url) 

Purge all cache entries for a given URL

Parameters

string $url

getCacheKey()

getCacheKey(\Guzzle\Http\Message\RequestInterface  $request) : string

Hash a request URL into a string that returns cache metadata

Parameters

\Guzzle\Http\Message\RequestInterface $request

Returns

string

getBodyKey()

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

Create a cache key for a response's body

Parameters

string $url

URL of the entry

\Guzzle\Http\EntityBodyInterface $body

Response body

Returns

string

requestsMatch()

requestsMatch(string  $vary, array  $r1, array  $r2) : boolean

Determines whether two Request HTTP header sets are non-varying

Parameters

string $vary

Response vary header

array $r1

HTTP header array

array $r2

HTTP header array

Returns

boolean

persistHeaders()

persistHeaders(\Guzzle\Http\Message\MessageInterface  $message) : array

Creates an array of cacheable and normalized message headers

Parameters

\Guzzle\Http\Message\MessageInterface $message

Returns

array