Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

(no description)

File Size: 404 lines (14 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: CacheMiddleware  - X-Ref

Class CacheMiddleware.

__construct(CacheStrategyInterface $cacheStrategy = null)   X-Ref

param: CacheStrategyInterface|null $cacheStrategy

setClient(Client $client)   X-Ref

param: Client $client

setCacheStorage(CacheStrategyInterface $cacheStorage)   X-Ref

param: CacheStrategyInterface $cacheStorage

getCacheStorage()   X-Ref

return: CacheStrategyInterface

setHttpMethods(array $methods)   X-Ref

param: array $methods

getHttpMethods()   X-Ref
No description

purgeReValidation()   X-Ref
Will be called at the end of the script.


__invoke(callable $handler)   X-Ref

param: callable $handler
return: callable

addToCache(CacheStrategyInterface $cache,RequestInterface $request,ResponseInterface $response,$update = false)   X-Ref
No description

addReValidationRequest(RequestInterface $request,CacheStrategyInterface &$cacheStorage,CacheEntry $cacheEntry)   X-Ref

param: RequestInterface       $request
param: CacheStrategyInterface $cacheStorage
param: CacheEntry             $cacheEntry
return: bool if added

getStaleResponse(CacheEntry $cacheEntry = null)   X-Ref

param: CacheEntry|null $cacheEntry
return: null|ResponseInterface

getRequestWithReValidationHeader(RequestInterface $request, CacheEntry $cacheEntry)   X-Ref

param: RequestInterface $request
param: CacheEntry       $cacheEntry
return: RequestInterface

getMiddleware(CacheStrategyInterface $cacheStorage = null)   X-Ref

param: CacheStrategyInterface|null $cacheStorage
return: CacheMiddleware the Middleware for Guzzle HandlerStack

invalidateCache(RequestInterface $request, ResponseInterface $response)   X-Ref

param: RequestInterface $request
param: ResponseInterface $response
return: ResponseInterface