1 cache.inc views_cache_set($cid, $data, $use_language = FALSE)

Set a cached item in the views cache.

This is just a convenience wrapper around cache_set().

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.

$use_language: If TRUE, the data will be cached specific to the currently active language.

File

core/modules/views/includes/cache.inc, line 183
Load Views' data so that it knows what is available to build queries from.

Code

function views_cache_set($cid, $data, $use_language = FALSE) {
  if ($use_language) {
    $cid .= ':' . $GLOBALS[LANGUAGE_TYPE_INTERFACE]->langcode;
  }

  cache('views')->set($cid, $data);
}