Send X-Database-Lagged header to help with debugging
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 21 Oct 2015 00:27:27 +0000 (17:27 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 21 Oct 2015 18:58:02 +0000 (18:58 +0000)
Change-Id: Ib654c49a61a1279091c5da92a2bef2ad1f992d23

includes/MediaWiki.php

index 3399790..7ae7c35 100644 (file)
@@ -515,6 +515,7 @@ class MediaWiki {
                if ( $factory->laggedSlaveUsed() ) {
                        $maxAge = $this->config->get( 'CdnMaxageLagged' );
                        $this->context->getOutput()->lowerCdnMaxage( $maxAge );
+                       $request->response()->header( "X-Database-Lagged: true" );
                        wfDebugLog( 'replication', "Lagged DB used; CDN cache TTL limited to $maxAge seconds" );
                }
        }