GWicke has uploaded a new change for review.

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

Change subject: Varnish: Don't disable caching for authenticated REST API 
requests
......................................................................

Varnish: Don't disable caching for authenticated REST API requests

Bug: T122673
Change-Id: Ibfd16c0bf181dad1678a3fe11ce9f009b0c267d5
---
M templates/varnish/text-common.inc.vcl.erb
1 file changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/62/261662/1

diff --git a/templates/varnish/text-common.inc.vcl.erb 
b/templates/varnish/text-common.inc.vcl.erb
index 518d202..cc92bdf 100644
--- a/templates/varnish/text-common.inc.vcl.erb
+++ b/templates/varnish/text-common.inc.vcl.erb
@@ -20,11 +20,13 @@
 sub evaluate_cookie {
        // A session or token cookie will prevent caching if varied on,
        // move the Cookie header out of the way otherwise.
-       // Note static and load.php exceptions to the user/token
-       // exceptions, as these should be cacheable even when logged in.
+       // Note static, load.php and REST API exceptions, as these should be
+       // cacheable even when logged in.
+       // FIXME: This ignores Vary completely.
        if (req.http.Cookie ~ "([sS]ession|Token)="
            && req.url !~ "^/static/"
-           && req.url !~ "^/w/load\.php") {
+               && req.url !~ "^/w/load\.php"
+               && req.url !~ "^/api/rest_v1/") {
                return (pass);
        } else {
                call stash_cookie;

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

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

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

Reply via email to