MediaWiki
1.34.0
|
Parser cache specific expiry check. More...
Public Member Functions | |
expired ( $touched) | |
Return true if this cached output object predates the global or per-article cache invalidation timestamps, or if it comes from an incompatible older version. More... | |
getCacheExpiry () | |
Returns the number of seconds after which this object should expire. More... | |
getCacheRevisionId () | |
getCacheTime () | |
isCacheable () | |
isDifferentRevision ( $id) | |
Return true if this cached output object is for a different revision of the page. More... | |
setCacheRevisionId ( $id) | |
setCacheTime ( $t) | |
setCacheTime() sets the timestamp expressing when the page has been rendered. More... | |
updateCacheExpiry ( $seconds) | |
Sets the number of seconds after which this object should expire. More... | |
Public Attributes | |
int null | $mCacheExpiry = null |
Seconds after which the object should expire, use 0 for not cacheable. More... | |
int null | $mCacheRevisionId = null |
Revision ID that was parsed. More... | |
string int | $mCacheTime = '' |
TS_MW timestamp when this object was generated, or -1 for not cacheable. More... | |
string[] | $mUsedOptions |
ParserOptions which have been taken into account to produce output. More... | |
string null | $mVersion = Parser::VERSION |
Compatibility check. More... | |
Parser cache specific expiry check.
Definition at line 29 of file CacheTime.php.
CacheTime::expired | ( | $touched | ) |
Return true if this cached output object predates the global or per-article cache invalidation timestamps, or if it comes from an incompatible older version.
string | $touched | The affected article's last touched timestamp |
Definition at line 167 of file CacheTime.php.
References $wgCacheEpoch, getCacheExpiry(), getCacheTime(), and isCacheable().
CacheTime::getCacheExpiry | ( | ) |
Returns the number of seconds after which this object should expire.
This method is used by ParserCache to determine how long the ParserOutput can be cached. The timestamp of expiry can be calculated by adding getCacheExpiry() to getCacheTime(). The value returned by getCacheExpiry is smaller or equal to the smallest number that was provided to a call of updateCacheExpiry(), and smaller or equal to the value of $wgParserCacheExpireTime.
Definition at line 129 of file CacheTime.php.
References $mCacheExpiry, and $wgParserCacheExpireTime.
Referenced by expired(), ParserOutput\hasDynamicContent(), isCacheable(), ParserCache\save(), MediaWiki\Storage\PageEditStash\storeStashValue(), and WikiPage\triggerOpportunisticLinksUpdate().
CacheTime::getCacheRevisionId | ( | ) |
Definition at line 87 of file CacheTime.php.
References $mCacheRevisionId.
Referenced by isDifferentRevision().
CacheTime::getCacheTime | ( | ) |
Definition at line 60 of file CacheTime.php.
References $mCacheTime.
Referenced by expired(), MediaWiki\Storage\PageEditStash\storeStashValue(), and WikiPage\triggerOpportunisticLinksUpdate().
CacheTime::isCacheable | ( | ) |
Definition at line 155 of file CacheTime.php.
References getCacheExpiry().
Referenced by expired().
CacheTime::isDifferentRevision | ( | $id | ) |
Return true if this cached output object is for a different revision of the page.
int | $id | The affected article's current revision id |
Definition at line 192 of file CacheTime.php.
References getCacheRevisionId().
CacheTime::setCacheRevisionId | ( | $id | ) |
int | null | $id | Revision ID |
Definition at line 95 of file CacheTime.php.
Referenced by ParserCache\save().
CacheTime::setCacheTime | ( | $t | ) |
setCacheTime() sets the timestamp expressing when the page has been rendered.
This does not control expiry, see updateCacheExpiry() for that!
string | $t | TS_MW timestamp |
Definition at line 74 of file CacheTime.php.
References $t, and wfSetVar().
Referenced by ParserCache\save().
CacheTime::updateCacheExpiry | ( | $seconds | ) |
Sets the number of seconds after which this object should expire.
This value is used with the ParserCache. If called with a value greater than the value provided at any previous call, the new call has no effect. The value returned by getCacheExpiry is smaller or equal to the smallest number that was provided as an argument to updateCacheExpiry().
Avoid using 0 if at all possible. Consider JavaScript for highly dynamic content.
int | $seconds |
Definition at line 112 of file CacheTime.php.
Referenced by ParserOutput\finalizeAdaptiveCacheExpiry(), and ParserOutput\updateRuntimeAdaptiveExpiry().
int null CacheTime::$mCacheExpiry = null |
Seconds after which the object should expire, use 0 for not cacheable.
Used in ParserCache.
Definition at line 50 of file CacheTime.php.
Referenced by getCacheExpiry().
int null CacheTime::$mCacheRevisionId = null |
Revision ID that was parsed.
Definition at line 55 of file CacheTime.php.
Referenced by getCacheRevisionId().
string int CacheTime::$mCacheTime = '' |
TS_MW timestamp when this object was generated, or -1 for not cacheable.
Used in ParserCache.
Definition at line 44 of file CacheTime.php.
Referenced by getCacheTime().
string [] CacheTime::$mUsedOptions |
ParserOptions which have been taken into account to produce output.
Definition at line 33 of file CacheTime.php.
string null CacheTime::$mVersion = Parser::VERSION |
Compatibility check.
Definition at line 38 of file CacheTime.php.