MediaWiki REL1_37
|
Page view caching in the file system. More...
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. | |
Public Member Functions inherited from FileCacheBase | |
cacheTimestamp () | |
Get the last-modified timestamp of the cache file. | |
clearCache () | |
Clear the cache for this page. | |
fetchText () | |
Get the uncompressed text from the cache. | |
getMissesRecent () | |
Roughly gets the cache misses in the last hour by unique visitors. | |
incrMissesRecent (WebRequest $request) | |
Roughly increments the cache misses in the last hour by unique visitors. | |
isCached () | |
Check if the cache file exists. | |
isCacheGood ( $timestamp='') | |
Check if up to date cache file exists. | |
saveText ( $text) | |
Save and compress text to the cache. | |
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. | |
Protected Member Functions inherited from FileCacheBase | |
__construct () | |
baseCacheDirectory () | |
Get the base file cache directory. | |
cacheMissKey (BagOStuff $cache) | |
cachePath () | |
Get the path to the cache file. | |
checkCacheDirs () | |
Create parent directors of $this->cachePath() | |
hashSubdirectory () | |
Return relative multi-level hash subdirectory (with trailing slash) or the empty string if not $wgFileCacheDepth. | |
useGzip () | |
Check if the cache is gzipped. | |
Static Protected Member Functions | |
static | cacheablePageActions () |
Cacheable actions. | |
Additional Inherited Members | |
Protected Attributes inherited from FileCacheBase | |
bool null | $mCached |
lazy loaded | |
$mExt = 'cache' | |
$mFilePath | |
$mKey | |
$mType = 'object' | |
$mUseGzip | |
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 35 of file HTMLFileCache.php.
HTMLFileCache::__construct | ( | $page, | |
$action | |||
) |
PageIdentity | string | $page | PageIdentity object or prefixed DB key string |
string | $action |
InvalidArgumentException |
Definition at line 46 of file HTMLFileCache.php.
|
staticprotected |
|
protected |
Get the base file cache directory.
Reimplemented from FileCacheBase.
Definition at line 70 of file HTMLFileCache.php.
References FileCacheBase\baseCacheDirectory().
|
static |
Clear the file caches for a page for all actions.
PageIdentity | string | $page | PageIdentity object or prefixed DB key string |
Definition at line 227 of file HTMLFileCache.php.
References $type.
Referenced by HtmlFileCacheUpdate\doUpdate().
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 144 of file HTMLFileCache.php.
References FileCacheBase\cachePath(), IContextSource\getOutput(), IContextSource\getTitle(), FileCacheBase\useGzip(), 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 registed 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 187 of file HTMLFileCache.php.
References FileCacheBase\saveText(), FileCacheBase\useGzip(), 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.
Reimplemented from FileCacheBase.
Definition at line 80 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 94 of file HTMLFileCache.php.
References IContextSource\getLanguage(), IContextSource\getRequest(), and IContextSource\getUser().
Referenced by Article\isFileCacheable(), MediaWiki\main(), HistoryAction\onView(), and MediaWiki\run().
const HTMLFileCache::MODE_NORMAL = 0 |
Definition at line 36 of file HTMLFileCache.php.
const HTMLFileCache::MODE_OUTAGE = 1 |
Definition at line 37 of file HTMLFileCache.php.
Referenced by MediaWiki\run().
const HTMLFileCache::MODE_REBUILD = 2 |
Definition at line 38 of file HTMLFileCache.php.
Referenced by RebuildFileCache\execute().