From: Andrew Green Date: Mon, 17 Oct 2016 15:00:47 +0000 (-0500) Subject: MessageCache: some inline comments X-Git-Tag: 1.31.0-rc.0~4729 X-Git-Url: http://git.cyclocoop.org/%22.%20generer_url_ecrire%28%22sites_tous%22%2C%22%22%29.%20%22?a=commitdiff_plain;h=279e8982222a0c58f27ce1fb4b6a0e80cf2fbaab;p=lhc%2Fweb%2Fwiklou.git MessageCache: some inline comments Change-Id: I42427eef73d86c1a2e99dfa22b5dae159542e243 --- diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php index 0c2f9de9b5..4e6b2fd396 100644 --- a/includes/cache/MessageCache.php +++ b/includes/cache/MessageCache.php @@ -496,6 +496,7 @@ class MessageCache { if ( $text === false ) { // Failed to fetch data; possible ES errors? // Store a marker to fetch on-demand as a workaround... + // TODO Use a differnt marker $entry = '!TOO BIG'; wfDebugLog( 'MessageCache', @@ -510,6 +511,10 @@ class MessageCache { $cache['VERSION'] = MSG_CACHE_VERSION; ksort( $cache ); + + # Hash for validating local cache (APC). No need to take into account + # messages larger than $wgMaxMsgCacheEntrySize, since those are only + # stored and fetched from memcache. $cache['HASH'] = md5( serialize( $cache ) ); $cache['EXPIRY'] = wfTimestamp( TS_MW, time() + $this->mExpiry ); @@ -568,7 +573,8 @@ class MessageCache { } ScopedCallback::consume( $scopedLock ); - // Relay the purge to APC and other DCs + // Relay the purge. Touching this check key expires cache contents + // and local cache (APC) validation hash across all datacenters. $this->wanCache->touchCheckKey( wfMemcKey( 'messages', $code ) ); // Also delete cached sidebar... just in case it is affected