function views_cache_set
3.x cache.inc | views_cache_set($cid, $data, $use_language = FALSE) |
2.x 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.
3 calls to views_cache_set()
- views_block in ./
views.module - Implementation of hook_block
- _views_discover_default_views in includes/
cache.inc - Scan all modules for default views and rebuild the default views cache.
- _views_fetch_data in includes/
cache.inc - Fetch Views' data from the cache
File
Code
function views_cache_set($cid, $data, $use_language = FALSE) {
global $language;
if (variable_get('views_skip_cache', FALSE)) {
return;
}
if ($use_language) {
$cid .= ':' . $language->language;
}
cache_set($cid, $data, 'cache_views');
}