You are here

function authcache_varnish_boot in Authenticated User Page Caching (Authcache) 7.2

Implements hook_boot().

File

modules/authcache_varnish/authcache_varnish.module, line 10
Authcache cache backend module for varnish.

Code

function authcache_varnish_boot() {
  if (authcache_varnish_request_validate()) {
    if (isset($_SERVER['HTTP_X_AUTHCACHE_KEY'])) {
      $initial_key = $_SERVER['HTTP_X_AUTHCACHE_KEY'];
    }
    else {
      $initial_key = authcache_backend_anonymous_key();
    }
    $vary_header = variable_get('authcache_varnish_vary', 'X-Authcache-Key');
    authcache_backend_init('authcache_varnish', $vary_header, $initial_key);
  }
}