BBlack has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/237369

Change subject: Compress js (and other text) in varnish
......................................................................

Compress js (and other text) in varnish

do_gzip will compress content on its way *into* the cache, if the
backend didn't already compress it for varnish.  It should be
harmless for types the backend is already compressing, but it's
nice to have the fallback here for content that the backend isn't
configured to compress.  This regex should cover the most common
cases...

Bug: T109040
Change-Id: I41453814b7e50cd6e3930eb6bb2d7d2a4ca5b66f
---
M modules/varnish/templates/vcl/wikimedia.vcl.erb
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/69/237369/1

diff --git a/modules/varnish/templates/vcl/wikimedia.vcl.erb 
b/modules/varnish/templates/vcl/wikimedia.vcl.erb
index 933d4eb..f2c3aed 100644
--- a/modules/varnish/templates/vcl/wikimedia.vcl.erb
+++ b/modules/varnish/templates/vcl/wikimedia.vcl.erb
@@ -466,8 +466,8 @@
        set beresp.grace = 60m;
 
 <% if @vcl_config.fetch("do_gzip", false) -%>
-       // Compress ico and SVG files
-       if (beresp.http.content-type ~ 
"^image/(x-icon|vnd\.microsoft\.icon|svg\+xml)$") {
+       // Compress compressible things if the backend didn't already
+       if (beresp.http.content-type ~ 
"^text/|^image/(x-icon|vnd\.microsoft\.icon)|(xml|html|javascript|json)$") {
                set beresp.do_gzip = true;
        }
 <% end -%>

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I41453814b7e50cd6e3930eb6bb2d7d2a4ca5b66f
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack <bbl...@wikimedia.org>

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

Reply via email to