function varnish_preprocess_page in Varnish 6
Implements hook_preprocess_page().
File
- ./
varnish.module, line 397 - varnish.module Provide drupal hooks for integration with the Varnish control layer.
Code
function varnish_preprocess_page(&$variables) {
global $conf;
// Set some special headers if the cache is disabled so that varnish will not
// cache the pages (for example when using captcha on them).
if (isset($conf['cache']) && empty($conf['cache'])) {
drupal_set_header('Pragma: no-cache');
drupal_set_header('Cache-Control: s-maxage=0, max-age=0, no-store, no-cache, must-revalidate');
}
}