Class CacheDispatcher
This filter will check whether the response was previously cached in the file system and served it back to the client if appropriate.
- DispatcherFilter implements CakeEventListener
- CacheDispatcher
Copyright: Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
License: MIT License
Location: Cake/Routing/Filter/CacheDispatcher.php
Properties summary
-
$priority
publicinteger
Default priority for all methods in this filter This filter should run before the request gets parsed by router
Inherited Properties
Method Summary
-
beforeDispatch() public
Checks whether the response was cached and set the body accordingly.
Method Detail
beforeDispatch() public ¶
beforeDispatch( CakeEvent
$event )
Checks whether the response was cached and set the body accordingly.
Parameters
-
CakeEvent
$event - containing the request and response object
Returns
Overrides
Methods inherited from DispatcherFilter
__construct() public ¶
__construct( array $settings = array() )
Constructor.
Parameters
- array $settings optional array()
- Configuration settings for the filter.
afterDispatch() public ¶
afterDispatch( CakeEvent
$event )
Method called after the controller served a request and generated a response. It is possible to alter the response object at this point as it is not sent to the client yet.
If false is returned, the event will be stopped and no more listeners will be notified.
Alternatively you can call $event->stopPropagation()
to achieve the same result.
Parameters
-
CakeEvent
$event container object having the
request
andresponse
keys in the data property.
Returns
boolean to stop the event dispatching or null to continue
implementedEvents() public ¶
implementedEvents( )
Returns the list of events this filter listens to.
Dispatcher notifies 2 different events Dispatcher.before
and Dispatcher.after
.
By default this class will attach preDispatch
and postDispatch
method respectively.
Override this method at will to only listen to the events you are interested in.