From: Roan Kattouw Date: Mon, 16 Feb 2015 20:20:21 +0000 (-0800) Subject: Fix URL comparison used for cacheability decision X-Git-Tag: 1.31.0-rc.0~12395 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=c7c1c4edbff0a698ddef92ce8672b66b9cb4c0be;p=lhc%2Fweb%2Fwiklou.git Fix URL comparison used for cacheability decision HTTPS hits were never marked as cacheable, because getFullRequestURL() (https://...) was being compared to getSquidURLs() (which are all http://...). Instead, expand the request URL with PROTO_INTERNAL and use that for the comparison. Bug: T89673 Change-Id: I3402820613bc6839fa2e2d053ddffcbf1b17ddb5 --- diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index 669d8e945f..2a0a405b6b 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -393,7 +393,11 @@ class MediaWiki { if ( $action instanceof Action ) { # Let Squid cache things if we can purge them. if ( $this->config->get( 'UseSquid' ) && - in_array( $request->getFullRequestURL(), $requestTitle->getSquidURLs() ) + in_array( + // Use PROTO_INTERNAL because that's what getSquidURLs() uses + wfExpandUrl( $request->getRequestURL(), PROTO_INTERNAL ), + $requestTitle->getSquidURLs() + ) ) { $output->setSquidMaxage( $this->config->get( 'SquidMaxage' ) ); }