Calculates and sets a cache ID used for the output cache.
string The generated cache ID.
public function generateOutputKey() {
global $user;
if (!isset($this->outputKey)) {
$key_data = array(
'result' => $this->view->result,
'roles' => array_keys($user->roles),
'super-user' => $user->uid == 1,
// special caching for super user.
'theme' => $GLOBALS['theme'],
'langcode' => language(LANGUAGE_TYPE_INTERFACE)->langcode,
'base_url' => $GLOBALS['base_url'],
);
$this->outputKey = $this->view->storage
->get('name') . ':' . $this->displayHandler->display['id'] . ':output:' . md5(serialize($key_data));
}
return $this->outputKey;
}