|
const | HEADER_CACHE_HIT = 'HIT' |
|
const | HEADER_CACHE_INFO = 'X-Kevinrob-Cache' |
|
const | HEADER_CACHE_MISS = 'MISS' |
|
const | HEADER_CACHE_STALE = 'STALE' |
|
const | HEADER_INVALIDATION = 'X-Kevinrob-GuzzleCache-Invalidation' |
|
const | HEADER_RE_VALIDATION = 'X-Kevinrob-GuzzleCache-ReValidation' |
|
|
CacheStrategyInterface | $cacheStorage |
|
Client | $client |
|
array | $httpMethods = ['GET' => true] |
| List of allowed HTTP methods to cache Key = method name (upscaling) Value = true.
|
|
array | $safeMethods = ['GET' => true, 'HEAD' => true, 'OPTIONS' => true, 'TRACE' => true] |
| List of safe methods.
|
|
array | $waitingRevalidate = [] |
| of Promise
|
|
◆ __construct()
- Parameters
-
CacheStrategyInterface | null | $cacheStrategy | |
◆ __invoke()
Kevinrob\GuzzleCache\CacheMiddleware::__invoke |
( |
callable | $handler | ) |
|
◆ addReValidationRequest()
- Parameters
-
RequestInterface | $request | |
CacheStrategyInterface | $cacheStorage | |
CacheEntry | $cacheEntry | |
- Return values
-
◆ addToCache()
- Parameters
-
CacheStrategyInterface | $cache | |
RequestInterface | $request | |
ResponseInterface | $response | |
bool | $update | cache |
- Return values
-
◆ getCacheStorage()
Kevinrob\GuzzleCache\CacheMiddleware::getCacheStorage |
( |
| ) |
|
◆ getMiddleware()
- Parameters
-
CacheStrategyInterface | null | $cacheStorage | |
- Return values
-
CacheMiddleware | the Middleware for Guzzle HandlerStack |
- Deprecated
- Use constructor =>
new CacheMiddleware()
◆ getRequestWithReValidationHeader()
static Kevinrob\GuzzleCache\CacheMiddleware::getRequestWithReValidationHeader |
( |
RequestInterface | $request, |
|
|
CacheEntry | $cacheEntry ) |
|
staticprotected |
- Parameters
-
RequestInterface | $request | |
CacheEntry | $cacheEntry | |
- Return values
-
◆ getStaleResponse()
static Kevinrob\GuzzleCache\CacheMiddleware::getStaleResponse |
( |
CacheEntry | $cacheEntry = null | ) |
|
|
staticprotected |
- Parameters
-
CacheEntry | null | $cacheEntry | |
- Return values
-
◆ setCacheStorage()
- Parameters
-
CacheStrategyInterface | $cacheStorage | |
◆ setClient()
Kevinrob\GuzzleCache\CacheMiddleware::setClient |
( |
Client | $client | ) |
|
◆ setHttpMethods()
Kevinrob\GuzzleCache\CacheMiddleware::setHttpMethods |
( |
array | $methods | ) |
|
◆ $safeMethods
array Kevinrob\GuzzleCache\CacheMiddleware::$safeMethods = ['GET' => true, 'HEAD' => true, 'OPTIONS' => true, 'TRACE' => true] |
|
protected |
The documentation for this class was generated from the following file:
- lib/guzzlehttp/kevinrob/guzzlecache/src/CacheMiddleware.php