You are here

function authcache_preprocess_page in Authenticated User Page Caching (Authcache) 7.2

Same name and namespace in other branches
  1. 6 authcache.module \authcache_preprocess_page()
  2. 7 authcache.module \authcache_preprocess_page()

Implements hook_preprocess_page().

Add post-render callback to tabs and action link elements. Caching will be canceled during post-render when no other modules mark the elements as being cacheable.

Related topics

File

./authcache.module, line 397
Authenticated User Page Caching (and anonymous users, too!)

Code

function authcache_preprocess_page(&$variables) {
  global $user;
  if (authcache_page_is_cacheable()) {
    authcache_element_suspect($variables['tabs'], t('Tabs on page. Enable authcache_menu or implement custom code capable of detecting when caching tabs is acceptable.'));
    authcache_element_suspect($variables['action_links'], t('Action links on page. Enable authcache_menu or implement custom code capable of detecting when caching local actions is acceptable.'));
    if (!$user->uid) {
      authcache_element_set_cacheable($variables['tabs']);
      authcache_element_set_cacheable($variables['action_links']);
    }
  }
}