Brian Wolff has uploaded a new change for review.
https://gerrit.wikimedia.org/r/73188
Change subject: Make {{#time:...}} expire parser cache after 12 hours.
......................................................................
Make {{#time:...}} expire parser cache after 12 hours.
We do this with {{CURRENTHOUR}} et al. 12 hours might be a bit
on the conservitive side perhaps, as {{CURRENTDAY}} expires after
a single hour.
Bug: 49803
Change-Id: I7972a2aea2494fdab3c122078694206d0c879aaf
---
M ParserFunctions_body.php
1 file changed, 5 insertions(+), 0 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ParserFunctions
refs/changes/88/73188/1
diff --git a/ParserFunctions_body.php b/ParserFunctions_body.php
index 967e833..6a1e932 100644
--- a/ParserFunctions_body.php
+++ b/ParserFunctions_body.php
@@ -412,6 +412,11 @@
public static function time( $parser, $format = '', $date = '',
$language = '', $local = false ) {
global $wgLocaltimezone;
self::registerClearHook();
+
+ // Since this function varries with time, reduce the parser
cache time
+ // to 12 hours.
+ $parser->getOutput()->updateCacheExpiry( 60*60*12 );
+
if ( $date === '' ) {
$cacheKey = $parser->getOptions()->getTimestamp();
$timestamp = new MWTimestamp( $cacheKey );
--
To view, visit https://gerrit.wikimedia.org/r/73188
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7972a2aea2494fdab3c122078694206d0c879aaf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ParserFunctions
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits