jenkins-bot has submitted this change and it was merged.

Change subject: Remove incomplete and dated 'wgUseETag' experiment
......................................................................


Remove incomplete and dated 'wgUseETag' experiment

Follows-up:
* 8ff36ebd (r9793) Set ETag header on article views.
* 8167b89e (r16205) Add $wgUseETag, false by default (broke Squid; T9098).

ETag is a useful alternative for If-Modified-Since (see T33639, T49529 about
use cases and bugs it may fix). However the current incomplete implementation
isn't useful.

It's a feature flag that has been disabled since 2006. Enabling it stores
ParserCache::getETag in OutputPage and sends it out as a response header.
It's ignored on incoming requests. We don't check If-None-Match for
'304 Not Modified' anywhere.

ResourceLoader has a working implementation that could be leveraged.

To be re-evaluated in the future. ParserCache::getETag() could use
improvement as well.

Change-Id: I37fd9d0ce1ce9bffb79243c6ae340403fdfd769f
---
M includes/DefaultSettings.php
M includes/OutputPage.php
M includes/page/Article.php
3 files changed, 5 insertions(+), 31 deletions(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 39e22a0..b8e1486 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -2552,12 +2552,6 @@
 $wgUseGzip = false;
 
 /**
- * Whether MediaWiki should send an ETag header. Seems to cause
- * broken behavior with Squid 2.6, see bug 7098.
- */
-$wgUseETag = false;
-
-/**
  * Clock skew or the one-second resolution of time() can occasionally cause 
cache
  * problems when the user requests two pages within a short period of time. 
This
  * variable adds a given number of seconds to vulnerable timestamps, thereby 
giving
diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index 5c7203d..15b70c8 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -104,21 +104,10 @@
        protected $mStatusCode;
 
        /**
-        * @var string Variable mLastModified and mEtag are used for sending 
cache control.
+        * @var string Used for sending cache control.
         *   The whole caching system should probably be moved into its own 
class.
         */
        protected $mLastModified = '';
-
-       /**
-        * Contains an HTTP Entity Tags (see RFC 2616 section 3.13) which is 
used
-        * as a unique identifier for the content. It is later used by the 
client
-        * to compare its cached version with the server version. Client sends
-        * headers If-Match and If-None-Match containing its locally cached 
ETAG value.
-        *
-        * To get more information, you will have to look at HTTP/1.1 protocol 
which
-        * is properly described in RFC 2616 : 
http://tools.ietf.org/html/rfc2616
-        */
-       private $mETag = false;
 
        /** @var array */
        protected $mCategoryLinks = [];
@@ -694,12 +683,10 @@
        }
 
        /**
-        * Set the value of the ETag HTTP header, only used if $wgUseETag is 
true
-        *
-        * @param string $tag Value of "ETag" header
+        * @deprecated since 1.28 Obsolete - wgUseETag experiment was removed.
+        * @param string $tag
         */
-       function setETag( $tag ) {
-               $this->mETag = $tag;
+       public function setETag( $tag ) {
        }
 
        /**
@@ -2156,9 +2143,6 @@
        public function sendCacheControl() {
                $response = $this->getRequest()->response();
                $config = $this->getConfig();
-               if ( $config->get( 'UseETag' ) && $this->mETag ) {
-                       $response->header( "ETag: $this->mETag" );
-               }
 
                $this->addVaryHeader( 'Cookie' );
                $this->addAcceptLanguage();
diff --git a/includes/page/Article.php b/includes/page/Article.php
index 1f1e8d6..2a6f88c 100644
--- a/includes/page/Article.php
+++ b/includes/page/Article.php
@@ -467,7 +467,7 @@
         * page of the given title.
         */
        public function view() {
-               global $wgUseFileCache, $wgUseETag, $wgDebugToolbar, 
$wgMaxRedirects;
+               global $wgUseFileCache, $wgDebugToolbar, $wgMaxRedirects;
 
                # Get variables from query string
                # As side effect this will load the revision and update the 
title
@@ -520,10 +520,6 @@
 
                # Try client and file cache
                if ( !$wgDebugToolbar && $oldid === 0 && 
$this->mPage->checkTouched() ) {
-                       if ( $wgUseETag ) {
-                               $outputPage->setETag( $parserCache->getETag( 
$this->mPage, $parserOptions ) );
-                       }
-
                        # Use the greatest of the page's timestamp or the 
timestamp of any
                        # redirect in the chain (bug 67849)
                        $timestamp = $this->mPage->getTouched();

-- 
To view, visit https://gerrit.wikimedia.org/r/296221
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I37fd9d0ce1ce9bffb79243c6ae340403fdfd769f
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle <krinklem...@gmail.com>
Gerrit-Reviewer: Aaron Schulz <asch...@wikimedia.org>
Gerrit-Reviewer: TheDJ <hartman.w...@gmail.com>
Gerrit-Reviewer: Tim Starling <tstarl...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to