function DrupalCacheInterface::set

7.x cache.inc DrupalCacheInterface::set($cid, $data, $expire = CACHE_PERMANENT)

Stores data in the persistent cache.

Parameters

$cid: The cache ID of the data to store.

$data: The data to store in the cache. Complex data types will be automatically serialized before insertion. Strings will be stored as plain text and not serialized.

$expire: One of the following values:

  • CACHE_PERMANENT: Indicates that the item should never be removed unless explicitly told to using cache_clear_all() with a cache ID.
  • CACHE_TEMPORARY: Indicates that the item should be removed at the next general cache wipe.
  • A Unix timestamp: Indicates that the item should be kept at least until the given time, after which it behaves like CACHE_TEMPORARY.
1 method overrides DrupalCacheInterface::set()
DrupalDatabaseCache::set in drupal-7.x/includes/cache.inc
Implements DrupalCacheInterface::set().

File

drupal-7.x/includes/cache.inc, line 268
Functions and interfaces for cache handling.

Class

DrupalCacheInterface
Defines an interface for cache implementations.

Code

function set($cid, $data, $expire = CACHE_PERMANENT);