function views_cache_set

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.

1 call to views_cache_set()
DisplayPluginBase::initDisplay in drupal/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php

File

drupal/core/modules/views/views.module, line 1698
Primarily Drupal hooks and global API functions to manipulate views.

Code

function views_cache_set($cid, $data, $use_language = FALSE) {
  if (config('views.settings')
    ->get('skip_cache')) {
    return;
  }
  if ($use_language) {
    $cid .= ':' . language(Language::TYPE_INTERFACE)->langcode;
  }
  cache('views_info')
    ->set($cid, $data);
}