FinishResponseSubscriber::setCacheControlNoCache

protected FinishResponseSubscriber::setCacheControlNoCache(Response $response)

Disable caching in the browser and for HTTP/1.1 proxies and clients.

Parameters

\Symfony\Component\HttpFoundation\Response $response: A response object.

File

core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php, line 260

Class

FinishResponseSubscriber
Response subscriber to handle finished responses.

Namespace

Drupal\Core\EventSubscriber

Code

protected function setCacheControlNoCache(Response $response) {
  $response->headers->set('Cache-Control', 'no-cache, must-revalidate');
}
doc_Drupal
2016-10-29 09:14:57
Comments
Leave a Comment

Please login to continue.