Mark Bergsma has submitted this change and it was merged.

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, 9 insertions(+), 0 deletions(-)

Approvals:
  Mark Bergsma: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/templates/varnish/mobile-frontend.inc.vcl.erb 
b/templates/varnish/mobile-frontend.inc.vcl.erb
index f6e156e..fed34d6 100644
--- a/templates/varnish/mobile-frontend.inc.vcl.erb
+++ b/templates/varnish/mobile-frontend.inc.vcl.erb
@@ -685,5 +685,14 @@
        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 ( ! resp.http.X-Analytics && req.http.X-Analytics ) {
+               set resp.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: merged
Gerrit-Change-Id: Iddde77a84504255e61943fcb52799b7852e068e0
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ottomata <[email protected]>
Gerrit-Reviewer: Mark Bergsma <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to