ProCache Static

ProCache methods for management of static cache files.

Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the ProCacheStatic class also inherits all the methods and properties of: ProCacheClass and Wire.

Show $var?     Show args?       Only hookable?    

Common

NameReturnSummary 
$procache->static->addTestData(string $action)
None

Add test mode data

 
$procache->static->cacheIndexBasename()
string

Return the index filename relative to the given host and https state

 
$procache->static->cacheIndexBasenames()
array

Get all possible index file basenames for cache files

 
$procache->static->cacheMaintenance()
int array

Cache maintenance to clear out cache files and DB entries have have expired

 
$procache->static->clear()
ProCacheStaticClear

Get ProCacheStaticClear instance

 
$procache->static->clearAll()
int

Clear entire cache

 
$procache->static->clearBranch(Page $page)
int

Clear entire Page branch (Page and everything below it)

 
$procache->static->clearPage(Page $page)
int array

Clear the cache for a specific page, including pageNum and urlSegment versions

 
$procache->static->clearPageNum(Page $page)
int array

Clear page pagination(s)

 
$procache->static->clearPageRoot(Page $page)
int array

Clear only root index file for given Page

 
$procache->static->clearPageUrlSegments(Page $page)
int array

Clear only URL segment(s) for page (optionally specifying which ones)

 
$procache->static->clearPages(PageArray $items)
int array

Clear the cache for multiple pages

 
$procache->static->clearPath(string $path)
int array

Clear by path or wildcard path, regardless of page

 
$procache->static->columnExists(string $column)
bool

Does given column exist?

 
$procache->static->executeCacheClearBehaviors(Page $page)
array

Execute cache clear behaviors for given Page (to be called after Page has been modified and saved)

 
$procache->static->findCacheEntries()
ProCacheStaticEntry

Find cache database rows of cache URLs for page matching given criteria

 
$procache->static->getBehaviorAbbrs()
array

Get array of [ ProCache::CACHECLEAR* => 'C' ] where 'C' is 1 char behavior abbreviation

 
$procache->static->getCacheClearBehaviors()
array

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

 
$procache->static->getCacheClearBehaviorsStr()
string

Get cache clear behaviors as string

 
$procache->static->getCacheFile(Page $page)
string

Get cache file for given Page and options

 
$procache->static->getCachePath()
string

Return the path where we store cache files, optionally for a page

$procache->static->getCachePathRoot()
string

Get root of path for storing cache files

$procache->static->getCachePathSegments(array $segments, Page $page, array $options)
array

Hookable method that can adjust the segments array as needed

$procache->static->getCacheTime()
array int string

Get the cache time for the given Template, or for all templates

 
$procache->static->getCacheTimesStr()
string

Get a string with all custom cache times

 
$procache->static->getContentTypeExt($item)
string

Get the content-type extension for the given Page or Template

 
$procache->static->getPageCachePathsLanguages(Page $page)
array

Get cache paths for Page in all languages that it is published in

 
$procache->static->getTable()
string

Get primary ProCache DB table name while also checking that schema is up-to-date

 
$procache->static->getTestData()
array

Get test mode data

 
$procache->static->getTestMode()
bool

@return bool

 
$procache->static->hasCacheFile(Page $page)
bool string

Get cache file for given page and options if it exists, or false if it does not

 
$procache->static->install()
None

Install

 
$procache->static->newEntry()
ProCacheStaticEntry

Create and return a new ProCacheStaticEntry

 
$procache->static->numCachedPages()
int

Return the number of pages in the cache

 
$procache->static->pageInfo(Page $page)
array bool

Return an info array about the given page’s ProCache info or false if not cached

 
$procache->static->renderCache(Page $page, $out)
bool array

Save a new static cache file

 
$procache->static->setTestMode(bool $testMode)
None

Enable or disable test mode

 
$procache->static->uninstall()
None

Uninstall

 

Constants

NameReturnSummary 
ProCacheStatic::flagsLanguage const8Flag that indicates URL in a non-default language 
ProCacheStatic::flagsPageNum const4Flag that indicates URL with pagination/page numbers greater than 1 
ProCacheStatic::flagsUrlSegments const2Flag that indicates one or more URL segments in the URL 

For hooks

These methods are only useful for hooking and should not be called directly.

Additional methods and properties

In addition to the methods and properties above, ProCacheStatic also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.252