Brion VIBBER has uploaded a new change for review.

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

Change subject: Work in progress: set .svg and .ico files to be compressed on 
bits.wikimedia.org
......................................................................

Work in progress: set .svg and .ico files to be compressed on bits.wikimedia.org

Not sure I know what I'm doing with Varnish config, so feel free to
kill and replace this. Based on chunks stolen from I64388ed0

Purpose of compressing .svgs is to save bandwidth on high-res/scalable
SVG icons used in today's modern client-side MediaWiki widgets.

Purpose of compressing .icos is to reduce bandwidth usage of the favicon.ico
which is bigger than it used to be since it's been enhanced with better
resolution and alpha channel for high-res and mobile screens.

Bug: 61442
Bug: 61443
Change-Id: I9fde04a7a581a7ccac435a12f7cfd300a14181d5
---
M templates/varnish/bits.inc.vcl.erb
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/87/113687/1

diff --git a/templates/varnish/bits.inc.vcl.erb 
b/templates/varnish/bits.inc.vcl.erb
index abbd7cf..4c74042 100644
--- a/templates/varnish/bits.inc.vcl.erb
+++ b/templates/varnish/bits.inc.vcl.erb
@@ -38,6 +38,12 @@
 }
 
 sub vcl_fetch {
+       /* Compress SVG and ICO files on the fly, they are inefficient */
+       /* I have no idea if this is doing it right, I'm making it up. Remove 
this comment if works. */
+       if (beresp.http.content.type ~ "image/svg+xml" || 
beresp.http.content.type ~ "image/x-icon") {
+               set beresp.do_gzip = true;
+       }
+
        /* Don't run the default vcl_fetch function */
        return (deliver);
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9fde04a7a581a7ccac435a12f7cfd300a14181d5
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Brion VIBBER <br...@wikimedia.org>

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

Reply via email to