ProCacheStatic::getCacheClearBehaviors() method

Get the cache clearing behaviors for all templates or a given template

If given no arguments, returns array in this format:


$returnValue = [
  'template-name' => [
     // one or more of these:
     CACHE_CLEAR_[BEHAVIOR] => CACHE_CLEAR_[BEHAVIOR],
     CACHE_CLEAR_PAGES => array(123,456,789),
     CACHE_CLEAR_SELECTOR => "selector string",
  ],
  'template-name' => [
     // behaviors
  ],
];

If given a template, then just the single dimensional array is returned containing
only the behvaiors.

Usage

// basic usage
$array = $proCacheStatic->getCacheClearBehaviors();

// usage with all arguments
$array = $proCacheStatic->getCacheClearBehaviors($options = []);

Arguments

NameType(s)Description
options (optional)null, Template, string, int, array

Specify any of the following options:

  • page (Page): Page to get cache behaviors for. You can use either this or template option (no need for both).
  • template (Template): Page template to retrieve behaviors for. Omit to retrieve for all cached templates.
  • cacheClearCustom (string): Value to use for cacheClearCustom setting rather than default.
  • onlyCustom (bool): Return behaviors for templates that are customized differently fron the defaults? (default=false)
  • verbose (bool): Get verbose data array? (default=false)
  • indexType (string): Type of index to use on returned array, 'value', 'abbr', 'name' (default='value')

Return value

array


ProCacheStatic methods and properties

API reference based on ProcessWire core version 3.0.244

Latest news

  • ProcessWire Weekly #559
    The 559th issue of ProcessWire Weekly brings in all the latest news from the ProcessWire community. Modules, sites, and more. Read on!
    Weekly.pw / 25 January 2025
  • ProcessWire 3.0.244 new main/master version
    ProcessWire 3.0.244 is our newest main/master/stable version. It's been more than a year in the making and is packed with tons of new features, issue fixes, optimizations and more. This post covers all the details.
    Blog / 18 January 2025
  • Subscribe to weekly ProcessWire news

“Yesterday I sent the client a short documentation for their ProcessWire-powered website. Today all features already used with no questions. #cmsdoneright—Marc Hinse, Web designer/developer