You are here

function hook_pre_emit_cache_max_age_alter in Drupal 8 Cache Backport 7

Allows to alter the cache max-age prior to emitting it.

Parameters

int $max_age: The max_age that will be emitted via hook_emit_cache_max_age().

1 invocation of hook_pre_emit_cache_max_age_alter()
core.inc in includes/core.inc
Core functions for the D8 caching system backport.

File

./d8cache.api.php, line 52
API documentation for D8Cache.

Code

function hook_pre_emit_cache_max_age_alter(&$max_age) {
  if (arg(0) == 'mymodule') {
    $max_age = CACHE_MAX_AGE_PERMANENT;
  }
}