HttpCache
class HttpCache extends HttpCache
Manages HTTP cache objects in a Container.
Properties
protected | $cacheDir | ||
protected | $kernel |
Methods
Returns an array of events that took place during processing of the last request.
Handles a Request to convert it to a Response.
Forwards the Request to the backend without storing the Response in the cache.
Invalidates non-safe methods (like POST, PUT, and DELETE).
Lookups a Response from the cache for the given Request.
Validates that a cache entry is fresh.
Unconditionally fetches a fresh response from the backend and stores it in the cache if is cacheable.
Checks whether the cache entry is "fresh enough" to satisfy the Request.
Returns an array of options to customize the Cache configuration.
No description
No description
Details
Response
handle(Request $request, int $type = HttpKernelInterface::MASTER_REQUEST, bool $catch = true)
Handles a Request to convert it to a Response.
When $catch is true, the implementation must catch all exceptions and do its best to convert them to a Response instance.
terminate(Request $request, Response $response)
Terminates a request/response cycle.
Should be called after sending the response and before shutting down the kernel.
protected Response
pass(Request $request, bool $catch = false)
Forwards the Request to the backend without storing the Response in the cache.
protected Response
invalidate(Request $request, bool $catch = false)
Invalidates non-safe methods (like POST, PUT, and DELETE).
protected Response
lookup(Request $request, bool $catch = false)
Lookups a Response from the cache for the given Request.
When a matching cache entry is found and is fresh, it uses it as the response without forwarding any request to the backend. When a matching cache entry is found but is stale, it attempts to "validate" the entry with the backend using conditional GET. When no matching cache entry is found, it triggers "miss" processing.
protected Response
validate(Request $request, Response $entry, bool $catch = false)
Validates that a cache entry is fresh.
The original request is used as a template for a conditional GET request with the backend.
protected Response
fetch(Request $request, bool $catch = false)
Unconditionally fetches a fresh response from the backend and stores it in the cache if is cacheable.
protected Response
forward(Request $request, bool $raw = false, Response $entry = null)
Forwards the Request to the backend and returns the Response.
protected bool
isFreshEnough(Request $request, Response $entry)
Checks whether the cache entry is "fresh enough" to satisfy the Request.