You are here

function panels_content_cache_clear_cache in Panels Content Cache 6

Same name and namespace in other branches
  1. 7 plugins/cache/content.inc \panels_content_cache_clear_cache()

Clear cached content.

Cache clears are always for an entire display, regardless of arguments.

Have not altered this function to take into account pane IDs (so we can clear individual panes) because all the other panels caching plugins I looked at did not do this either, so have left this for now as it requires further investigation.

2 calls to panels_content_cache_clear_cache()
panels_content_cache_menu_clear_cache in ./panels_content_cache.module
Clear any panels displays that are associated with a menu. This function looks up any panel displays by menu_name that are in the panels_content_cache table, and clears the cache on those displays.
panels_content_cache_node_clear_cache in ./panels_content_cache.module
This function is called from hook_nodeapi() and invalidates the panel cache when a node is updated and it matches the criteria chosen in the caching of any panels.
1 string reference to 'panels_content_cache_clear_cache'
content.inc in plugins/cache/content.inc
Provides a content-based caching option for panel panes.

File

plugins/cache/content.inc, line 59
Provides a content-based caching option for panel panes.

Code

function panels_content_cache_clear_cache($display) {
  $cid = 'panels_content_cache';

  // This is used in case this is an in-code display, which means did will be something like 'new-1'.
  if (isset($display->owner) && isset($display->owner->id)) {
    $cid .= ':' . $display->owner->id;
  }
  $cid .= ':' . $display->did;
  cache_clear_all($cid, 'cache', TRUE);
}