trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject [trafficserver] branch master updated: Adds 304 to the default status codes to be compressible
Date Thu, 29 Mar 2018 22:00:54 GMT
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new d8d1ac6  Adds 304 to the default status codes to be compressible
d8d1ac6 is described below

commit d8d1ac6d73ea34da17171a5c42fa71bcb905d9bf
Author: Leif Hedstrom <zwoop@apache.org>
AuthorDate: Thu Mar 29 13:39:07 2018 -0600

    Adds 304 to the default status codes to be compressible
    
    Miles ran into an issue where something is stale in cache, and we end
    up returning a 304, we don't send proper Vary headers, and this causes
    things to be bad.
---
 plugins/gzip/configuration.cc | 6 +-----
 plugins/gzip/configuration.h  | 4 +++-
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/plugins/gzip/configuration.cc b/plugins/gzip/configuration.cc
index 6373a00..155b5de 100644
--- a/plugins/gzip/configuration.cc
+++ b/plugins/gzip/configuration.cc
@@ -196,12 +196,8 @@ HostConfiguration::is_url_allowed(const char *url, int url_len)
 bool
 HostConfiguration::is_status_code_compressible(const TSHttpStatus status_code) const
 {
-  // maintain backwards compatibility/usability out of the box
-  if (compressible_status_codes_.empty()) {
-    return status_code == 200;
-  }
-
   std::set<TSHttpStatus>::const_iterator it = compressible_status_codes_.find(status_code);
+
   return it != compressible_status_codes_.end();
 }
 
diff --git a/plugins/gzip/configuration.h b/plugins/gzip/configuration.h
index b252296..d8c4166 100644
--- a/plugins/gzip/configuration.h
+++ b/plugins/gzip/configuration.h
@@ -149,7 +149,9 @@ private:
   StringContainer compressible_content_types_;
   StringContainer disallows_;
   StringContainer allows_;
-  std::set<TSHttpStatus> compressible_status_codes_;
+  // maintain backwards compatibility/usability out of the box
+  std::set<TSHttpStatus> compressible_status_codes_ = {TS_HTTP_STATUS_OK, TS_HTTP_STATUS_PARTIAL_CONTENT,
+                                                       TS_HTTP_STATUS_NOT_MODIFIED};
 
   DISALLOW_COPY_AND_ASSIGN(HostConfiguration);
 };

-- 
To stop receiving notification emails like this one, please contact
zwoop@apache.org.

Mime
View raw message