PHP Class Kevinrob\GuzzleCache\Strategy\GreedyCacheStrategy

It can be used to cache responses in spite of any cache related response headers, but it SHOULDN'T be used unless absolutely necessary, e.g. when accessing badly designed APIs without Cache control. Obviously, this follows no RFC :(.
Inheritance: extends PrivateCacheStrategy
Afficher le fichier Open project: kevinrob/guzzle-cache-middleware

Protected Properties

Свойство Type Description
$ttl integer

Méthodes publiques

Méthode Description
__construct ( Kevinrob\GuzzleCache\Storage\CacheStorageInterface $cache = null, $ttl )
cache ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response )
fetch ( Psr\Http\Message\RequestInterface $request )

Méthodes protégées

Méthode Description
getCacheKey ( Psr\Http\Message\RequestInterface $request )
getCacheObject ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response )

Method Details

__construct() public méthode

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

cache() public méthode

public cache ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response )
$request Psr\Http\Message\RequestInterface
$response Psr\Http\Message\ResponseInterface

fetch() public méthode

public fetch ( Psr\Http\Message\RequestInterface $request )
$request Psr\Http\Message\RequestInterface

getCacheKey() protected méthode

protected getCacheKey ( Psr\Http\Message\RequestInterface $request )
$request Psr\Http\Message\RequestInterface

getCacheObject() protected méthode

protected getCacheObject ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response )
$request Psr\Http\Message\RequestInterface
$response Psr\Http\Message\ResponseInterface

Property Details

$ttl protected_oe property

protected int $ttl
Résultat integer