Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CachePluginBase.php

function CachePluginBase::cacheSetMaxAge

Determines cache expiration time based on its type.

Plugins must override this to implement expiration in the cache table.

Parameters

string $type: The cache type.

Return value

int Either an offset from the request time to indicate when the cache expires, or \Drupal\Core\Cache\Cache::PERMANENT to indicate that the cache does not expire. Defaults to \Drupal\Core\Cache\Cache::PERMANENT.

1 call to CachePluginBase::cacheSetMaxAge()
CachePluginBase::cacheSet in core/modules/views/src/Plugin/views/cache/CachePluginBase.php
Save data to the cache.
1 method overrides CachePluginBase::cacheSetMaxAge()
Time::cacheSetMaxAge in core/modules/views/src/Plugin/views/cache/Time.php
Determines cache expiration time based on its type.

File

core/modules/views/src/Plugin/views/cache/CachePluginBase.php, line 97

Class

CachePluginBase
The base plugin to handle caching.

Namespace

Drupal\views\Plugin\views\cache

Code

protected function cacheSetMaxAge($type) {
    return Cache::PERMANENT;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal