cache_example.module 1.08 KB
<?php

/**
 * @file
 * Outlines how a module can use the Cache API.
 *
 * @todo: Demonstrate allowing invalid cache items.
 * @todo: Demonstrate deleteing cache entries.
 * @todo: Demonstrate deleteing cache tags.
 * @todo: Demonstrate deleteing all cache items.
 * @todo: Demonstrate invalidating cache entries.
 * @todo: Demonstrate invalidating cache tags.
 * @todo: Demonstrate invalidating all cache items.
 */

/**
 * @defgroup cache_example Example: Cache API
 * @ingroup examples
 * @{
 * Outlines how a module can use the Cache API.
 *
 * Cache API allows us to cache data that is heavy to calculate. As this can
 * significantly speed up the Drupal site, it is recommended to use cache
 * mechanism when it is appropriate.
 *
 * Cache in Drupal is very easy to use. This example will search entire Drupal
 * folder and display all files. Since this operation includes filesystem it can
 * take a while. This list will not change much on production
 * websites, so we decide to cache it.
 *
 * @see \Drupal\Core\Cache\CacheBackendInterface
 */

/**
 * @} End of "defgroup cache_example".
 */