You are here

function authcache_backend_init in Authenticated User Page Caching (Authcache) 7.2

Initialize the cache backend module.

Related topics

3 calls to authcache_backend_init()
authcache_backend_test_boot in tests/authcache_backend_test.module
Implements hook_boot().
authcache_builtin_cacheinc_retrieve_cache_page in modules/authcache_builtin/authcache_builtin.cache.inc
Send cached page to browser, if found.
authcache_varnish_boot in modules/authcache_varnish/authcache_varnish.module
Implements hook_boot().
1 string reference to 'authcache_backend_init'
authcache_builtin_cacheinc_retrieve_cache_page in modules/authcache_builtin/authcache_builtin.cache.inc
Send cached page to browser, if found.

File

./authcache.cache.inc, line 157
Defines authcache aware copy of drupal_serve_page_from_cache().

Code

function authcache_backend_init($module, $vary_header, $initial_key) {
  if (drupal_is_cli()) {
    return FALSE;
  }

  // Determine whether a cache backend already has been chosen.
  if (authcache_backend()) {
    return FALSE;
  }

  // Determine whether we can savely set the given vary header.
  if (!authcache_backend_check_vary($vary_header)) {
    return FALSE;
  }

  // Finally set vary header, if not empty, and cache backend.
  if ($vary_header) {
    drupal_add_http_header('Vary', $vary_header);
  }
  authcache_backend($module);
  authcache_backend_initial_key($initial_key);
  $initial_session_id = isset($_COOKIE[session_name()]) ? $_COOKIE[session_name()] : FALSE;
  authcache_backend_initial_session_id($initial_session_id);
  return TRUE;
}