MediaWiki master
|
Page view caching in the file system. More...
Inherits FileCacheBase.
Public Member Functions | |
__construct ( $page, $action) | |
loadFromFileCache (IContextSource $context, $mode=self::MODE_NORMAL) | |
Read from cache to context output. | |
saveToFileCache ( $text) | |
Save this cache object with the given text. | |
Static Public Member Functions | |
static | clearFileCache ( $page) |
Clear the file caches for a page for all actions. | |
static | useFileCache (IContextSource $context, $mode=self::MODE_NORMAL) |
Check if pages can be cached for this request/user. | |
Public Attributes | |
const | MODE_NORMAL = 0 |
const | MODE_OUTAGE = 1 |
const | MODE_REBUILD = 2 |
Protected Member Functions | |
cacheDirectory () | |
Get the base file cache directory. | |
typeSubdirectory () | |
Get the cache type subdirectory (with the trailing slash) or the empty string Alter the type -> directory mapping to put action=view cache at the root. | |
Page view caching in the file system.
The only cacheable actions are "view" and "history". Also special pages will not be cached.
Definition at line 38 of file HTMLFileCache.php.
HTMLFileCache::__construct | ( | $page, | |
$action | |||
) |
PageIdentity | string | $page | PageIdentity object or prefixed DB key string |
string | $action |
Definition at line 52 of file HTMLFileCache.php.
|
protected |
|
static |
Clear the file caches for a page for all actions.
PageIdentity | string | $page | PageIdentity object or prefixed DB key string |
Definition at line 226 of file HTMLFileCache.php.
HTMLFileCache::loadFromFileCache | ( | IContextSource | $context, |
$mode = self::MODE_NORMAL |
|||
) |
Read from cache to context output.
IContextSource | $context | |
int | $mode | One of the HTMLFileCache::MODE_* constants |
Definition at line 145 of file HTMLFileCache.php.
References MediaWiki\Context\IContextSource\getOutput(), MediaWiki\Context\IContextSource\getTitle(), wfClientAcceptsGzip(), and wfDebug().
HTMLFileCache::saveToFileCache | ( | $text | ) |
Save this cache object with the given text.
Use this as an ob_start() handler.
Normally this is only registered as a handler if $wgUseFileCache is on. If can be explicitly called by rebuildFileCache.php when it takes over handling file caching itself, disabling any automatic handling the process.
string | $text |
Definition at line 186 of file HTMLFileCache.php.
References wfClientAcceptsGzip(), wfDebug(), and wfTimestampNow().
|
protected |
Get the cache type subdirectory (with the trailing slash) or the empty string Alter the type -> directory mapping to put action=view cache at the root.
Definition at line 78 of file HTMLFileCache.php.
|
static |
Check if pages can be cached for this request/user.
IContextSource | $context | |
int | $mode | One of the HTMLFileCache::MODE_* constants (since 1.28) |
Definition at line 92 of file HTMLFileCache.php.
References MediaWiki\Context\IContextSource\getLanguage(), MediaWiki\Context\IContextSource\getRequest(), and MediaWiki\Context\IContextSource\getUser().
const HTMLFileCache::MODE_NORMAL = 0 |
Definition at line 39 of file HTMLFileCache.php.
const HTMLFileCache::MODE_OUTAGE = 1 |
Definition at line 40 of file HTMLFileCache.php.
const HTMLFileCache::MODE_REBUILD = 2 |
Definition at line 41 of file HTMLFileCache.php.