r113751 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113750‎ | r113751 | r113752 >
Date:19:25, 13 March 2012
Author:preilly
Status:resolved (Comments)
Tags:
Comment:
make memcache key valid for the day
Modified paths:
  • /trunk/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.body.php
@@ -520,8 +520,8 @@
521521 $rev = null;
522522
523523 if ( $pageName ) {
524 -
525 - $memcKey = wfMemcKey( 'zero-rated-mobile-access-foreign-options-', md5( $pageName ) );
 524+ $day = date( 'Ymd' );
 525+ $memcKey = wfMemcKey( 'zero-rated-mobile-access-foreign-options-', md5( $pageName ), $day );
526526 $foreignOptions = $wgMemc->get( $memcKey );
527527
528528 if ( !$foreignOptions ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r1137521.19wmf: MFT r113751preilly19:26, 13 March 2012
r113760use a GMT/UTC date/time instead of local time/datepreilly20:45, 13 March 2012

Comments

#Comment by Brion VIBBER (talk | contribs)   20:43, 13 March 2012

Avoid using local time for things like this; we might well be fiddling the local timezone around. Consider gmdate() if this is appropriate. Would it make more sense to just expire after a day instead of putting it in the key?

#Comment by Preilly (talk | contribs)   20:48, 13 March 2012

I've switched to gmdate in r113760.

Status & tagging log