PHP Class Kevinrob\GuzzleCache\Strategy\PrivateCacheStrategy

Pay attention to share storage between application with caution! For example, a response with cache-control header "private, max-age=60" will be cached by this strategy. The rules applied are from RFC 7234.
See also: https://tools.ietf.org/html/rfc7234
Inheritance: implements Kevinrob\GuzzleCache\Strategy\CacheStrategyInterface
Afficher le fichier Open project: kevinrob/guzzle-cache-middleware Class Usage Examples

Protected Properties

Свойство Type Description
$ageKey string[]
$statusAccepted int[]
$storage Kevinrob\GuzzleCache\Storage\CacheStorageInterface

Méthodes publiques

Méthode Description
__construct ( Kevinrob\GuzzleCache\Storage\CacheStorageInterface $cache = null )
cache ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response ) : boolean
fetch ( Psr\Http\Message\RequestInterface $request ) : CacheEntry | null Return a CacheEntry or null if no cache.
update ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response ) : boolean

Méthodes protégées

Méthode Description
getCacheKey ( Psr\Http\Message\RequestInterface $request ) : string
getCacheObject ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response ) : CacheEntry | null

Method Details

__construct() public méthode

public __construct ( Kevinrob\GuzzleCache\Storage\CacheStorageInterface $cache = null )
$cache Kevinrob\GuzzleCache\Storage\CacheStorageInterface

cache() public méthode

public cache ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response ) : boolean
$request Psr\Http\Message\RequestInterface
$response Psr\Http\Message\ResponseInterface
Résultat boolean true if success

fetch() public méthode

Return a CacheEntry or null if no cache.
public fetch ( Psr\Http\Message\RequestInterface $request ) : CacheEntry | null
$request Psr\Http\Message\RequestInterface
Résultat Kevinrob\GuzzleCache\CacheEntry | null

getCacheKey() protected méthode

protected getCacheKey ( Psr\Http\Message\RequestInterface $request ) : string
$request Psr\Http\Message\RequestInterface
Résultat string

getCacheObject() protected méthode

protected getCacheObject ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response ) : CacheEntry | null
$request Psr\Http\Message\RequestInterface
$response Psr\Http\Message\ResponseInterface
Résultat Kevinrob\GuzzleCache\CacheEntry | null entry to save, null if can't cache it

update() public méthode

public update ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response ) : boolean
$request Psr\Http\Message\RequestInterface
$response Psr\Http\Message\ResponseInterface
Résultat boolean true if success

Property Details

$ageKey protected_oe property

protected string[] $ageKey
Résultat string[]

$statusAccepted protected_oe property

protected int[] $statusAccepted
Résultat int[]

$storage protected_oe property

protected CacheStorageInterface,Kevinrob\GuzzleCache\Storage $storage
Résultat Kevinrob\GuzzleCache\Storage\CacheStorageInterface