protected function PageController::getDefaultCacheInfo in Render cache 7.2
Provides the cache info for all objects based on the context.
Parameters
array $context:
Return value
array
Overrides BaseController::getDefaultCacheInfo
File
- modules/
controller/ render_cache_page/ src/ RenderCache/ Controller/ PageController.php, line 52 - Contains \Drupal\render_cache_page\RenderCache\Controller\PageController
Class
- PageController
- PageController - Provides render caching for page objects.
Namespace
Drupal\render_cache_page\RenderCache\ControllerCode
protected function getDefaultCacheInfo($context) {
$default_cache_info = parent::getDefaultCacheInfo($context);
// The page cache is per page and per role by default.
$default_cache_info['granularity'] = DRUPAL_CACHE_PER_ROLE | DRUPAL_CACHE_PER_PAGE;
$default_cache_info['render_cache_cache_strategy'] = \RenderCache::RENDER_CACHE_STRATEGY_DIRECT_RENDER;
$default_cache_info['render_cache_preserve_original'] = TRUE;
return $default_cache_info;
}