interface CacheCollectorInterface

Provides a caching wrapper to be used in place of large structures.

This should be extended by systems that need to cache large amounts of data to calling functions. These structures can become very large, so this class is used to allow different strategies to be used for caching internally (lazy loading, building caches over time etc.). This can dramatically reduce the amount of data that needs to be loaded from cache backends on each request, and memory usage from static caches of that same data.

The default implementation is \Drupal\Core\Cache\CacheCollector.

Hierarchy

Related topics

Cache API
Information about the Drupal Cache API

File

core/lib/Drupal/Core/Cache/CacheCollectorInterface.php, line 19

Namespace

Drupal\Core\Cache

Members

Name Modifiers Type Description
CacheCollectorInterface::clear public function Clears the collected cache entry.
CacheCollectorInterface::delete public function Deletes the element.
CacheCollectorInterface::get public function Gets value from the cache.
CacheCollectorInterface::has public function Returns whether data exists for this key.
CacheCollectorInterface::reset public function Resets the local cache.
CacheCollectorInterface::set public function Sets cache data.

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Cache!CacheCollectorInterface.php/interface/CacheCollectorInterface/8.1.x