function FinishResponseSubscriber::setCacheControlNoCache
Disable caching in the browser and for HTTP/1.1 proxies and clients.
Parameters
\Symfony\Component\HttpFoundation\Response $response: A response object.
1 call to FinishResponseSubscriber::setCacheControlNoCache()
- FinishResponseSubscriber::setResponseNotCacheable in core/
lib/ Drupal/ Core/ EventSubscriber/ FinishResponseSubscriber.php - Add Cache-Control and Expires headers to a response which is not cacheable.
File
-
core/
lib/ Drupal/ Core/ EventSubscriber/ FinishResponseSubscriber.php, line 265
Class
- FinishResponseSubscriber
- Response subscriber to handle finished responses.
Namespace
Drupal\Core\EventSubscriberCode
protected function setCacheControlNoCache(Response $response) {
$response->headers
->set('Cache-Control', 'no-cache, must-revalidate');
}