You are here

function _authcache_key in Authenticated User Page Caching (Authcache) 6

Same name and namespace in other branches
  1. 7 authcache.helpers.inc \_authcache_key()

Returns caching key based on user's role.

This is prefixed to the URL in the cache_page bin.

2 calls to _authcache_key()
authcache_user in ./authcache.module
Implements hook_user().
_authcache_shutdown_save_page in ./authcache.helpers.inc
Save page to cache

File

./authcache.helpers.inc, line 349
Helper functions for the Authcache module (no Drupal hooks here).

Code

function _authcache_key($account) {
  if (!$account->uid) {
    return '';
  }
  $keys = implode('.', array_keys($account->roles));
  return substr(md5($keys . drupal_get_private_key()), 0, 6);
}