Factbox output caching
Use a EntityCache to avoid unaltered content being re-parsed every time the OutputPage hook is executed.
GNU GPL v2+
- Since
- 1.9
- Author
- mwjames
◆ __construct()
SMW\Factbox\CachedFactbox::__construct |
( |
EntityCache |
$entityCache | ) |
|
◆ addContentToCache()
SMW\Factbox\CachedFactbox::addContentToCache |
( |
|
$key, |
|
|
|
$text, |
|
|
|
$rev_id = null , |
|
|
|
$lang = 'en' , |
|
|
|
$feature_set = null |
|
) |
| |
- Since
- 2.2
- Parameters
-
string | $key | |
string | $text | |
integer | null | $revisionId | |
◆ getTimestamp()
SMW\Factbox\CachedFactbox::getTimestamp |
( |
| ) |
|
◆ isCached()
SMW\Factbox\CachedFactbox::isCached |
( |
| ) |
|
◆ isEnabled()
SMW\Factbox\CachedFactbox::isEnabled |
( |
|
$isEnabled | ) |
|
◆ makeCacheKey()
static SMW\Factbox\CachedFactbox::makeCacheKey |
( |
|
$id | ) |
|
|
static |
◆ prepare()
SMW\Factbox\CachedFactbox::prepare |
( |
OutputPage & |
$outputPage, |
|
|
ParserOutput |
$parserOutput |
|
) |
| |
Prepare and update the OutputPage property
Factbox content is either retrieved from a CacheStore or re-parsed from the Factbox object
Altered content is tracked using the revision Id, getLatestRevID() only changes after a content modification has occurred.
- Since
- 1.9
- Parameters
-
OutputPage | &$outputPage | |
ParserOutput | $parserOutput | |
◆ retrieveContent()
SMW\Factbox\CachedFactbox::retrieveContent |
( |
OutputPage |
$outputPage | ) |
|
Returns parsed Factbox content from either the OutputPage property or from the Cache
- Since
- 1.9
- Parameters
-
- Returns
- string
◆ setCacheTTL()
SMW\Factbox\CachedFactbox::setCacheTTL |
( |
|
$cacheTTL | ) |
|
◆ setFeatureSet()
SMW\Factbox\CachedFactbox::setFeatureSet |
( |
|
$featureSet | ) |
|
◆ setShowFactbox()
SMW\Factbox\CachedFactbox::setShowFactbox |
( |
|
$showFactbox | ) |
|
◆ setShowFactboxEdit()
SMW\Factbox\CachedFactbox::setShowFactboxEdit |
( |
|
$showFactboxEdit | ) |
|
The documentation for this class was generated from the following file: