ProCacheStaticClear::clearPage() method

Clear the cache for a specific page

Default behavior is to clear for all languages, paginations and URL segment variations.
To clear only specific languages, paginations or URL segments, use the options.

Usage

// basic usage
$int = $clear->clearPage(Page $page);

// usage with all arguments
$int = $clear->clearPage(Page $page, array $options = []);

Arguments

NameType(s)Description
$pagePage
$options (optional)array
  • language (string|int|Language|bool): Clear only this language Default:''
  • urlSegmentStr (string): Clear only entries matching this URL segment string, wildcards OR regex OK Default:''
  • urlSegments (array|bool): Clear only entries having any of these URL segments, false to clear no URL segments, omit to clear all. Default:[]
  • pageNum (int|bool): Clear only pagination number (i.e. 2), true to clear all pageNum>1, false to clear no pageNum>1, omit to clear all Default:0
  • clearRoot (bool|null): Clear root index of page path? Default:false when specific URL segments or paginations requested, true otherwise
  • rmdir (bool): Remove directories rather than index files? Not recommended unless all below (children, segments, etc.) Default:false
  • getFiles (bool): Get array of files that were cleared, rather than a count? Default:false

Return value

int array

Quantity or array of files and/or directories that were removed


$clear methods and properties

API reference based on ProcessWire core version 3.0.252