From: Aaron Schulz Date: Wed, 23 Dec 2015 20:50:59 +0000 (-0800) Subject: Use dedicated cookie for skipping CDN cache after initiating DB changes X-Git-Tag: 1.31.0-rc.0~8354^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=5e0162f9197b854f75820a906b0a6c31b164ffda;p=lhc%2Fweb%2Fwiklou.git Use dedicated cookie for skipping CDN cache after initiating DB changes This sets a short lived cookie that more robustly takes on the role that the session initiation in SubmitAction has. It can be used via Varnish VCL. Bug: T121440 Change-Id: I6214a0bce4e8bbbecbc3f9513e7c852285b4a9db --- diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index 3b5a1b107c..c00be95121 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -567,7 +567,9 @@ class MediaWiki { $request = $context->getRequest(); if ( $request->wasPosted() && $factory->hasOrMadeRecentMasterChanges() ) { $expires = time() + $config->get( 'DataCenterUpdateStickTTL' ); - $request->response()->setCookie( 'UseDC', 'master', $expires, array( 'prefix' => '' ) ); + $options = array( 'prefix' => '' ); + $request->response()->setCookie( 'UseDC', 'master', $expires, $options ); + $request->response()->setCookie( 'UseCDNCache', 'false', $expires, $options ); } // Avoid letting a few seconds of slave lag cause a month of stale data