/Drupal 8

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.


Related topics

Cache API
Information about the Drupal Cache API


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




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.