Ottomata has uploaded a new change for review.

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


Change subject: Setting X-Analytics header in vcl_deliver.
......................................................................

Setting X-Analytics header in vcl_deliver.

This handles the case where requests that need X-Analytics set
but are already cached.  This conditional will be removed once
we are sure all of the relevant requests are cached with
X-Analytics set.

Change-Id: Iddde77a84504255e61943fcb52799b7852e068e0
---
M templates/varnish/mobile-frontend.inc.vcl.erb
1 file changed, 11 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/66/59166/1

diff --git a/templates/varnish/mobile-frontend.inc.vcl.erb 
b/templates/varnish/mobile-frontend.inc.vcl.erb
index f6e156e..2677937 100644
--- a/templates/varnish/mobile-frontend.inc.vcl.erb
+++ b/templates/varnish/mobile-frontend.inc.vcl.erb
@@ -685,5 +685,16 @@
        if (req.url == "/favicon.ico" || req.url ~ 
"^/apple-touch-icon(-precomposed)?\.png$" || req.url ~ 
"^/w/index\.php\?title=.*:Gadget-.*&[0-9]+$") {
                set resp.http.Cache-Control = "s-maxage=3600, max-age=3600";
        }
+
+       // FIXME: This makes sure the X-Analytics header
+       // is properly set even if the request is already cached.
+       // This can be removed once we are sure that all requests
+       // that should have this header set but are cached without
+       // it set have been invalidated.
+       if ( beresp.http.X-Analytics ) {
+               # Do nothing, X-Analytics has already been handled
+       } else if ( req.http.X-Analytics ) {
+               set beresp.http.X-Analytics = req.http.X-Analytics;
+       }
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iddde77a84504255e61943fcb52799b7852e068e0
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ottomata <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to