Gilles has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/362192 )

Change subject: Fix Swift file purging
......................................................................

Fix Swift file purging

The xkey purge was just an experiment

Change-Id: I892fb7b296226e8f8a49ec4be399acfc0431132a
---
M puppet/modules/thumbor/templates/varnish.vcl.erb
1 file changed, 6 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/92/362192/1

diff --git a/puppet/modules/thumbor/templates/varnish.vcl.erb 
b/puppet/modules/thumbor/templates/varnish.vcl.erb
index 3721441..ad1911d 100644
--- a/puppet/modules/thumbor/templates/varnish.vcl.erb
+++ b/puppet/modules/thumbor/templates/varnish.vcl.erb
@@ -12,6 +12,11 @@
         set req.url = regsub(req.url, "(.*):8080/(.*)", "\1:6081/\2");
     }
 
+    # Swift expects /lang/project/foo
+    if (req.url ~ "^/images/") {
+        set req.url = "/wiki/dev/" + regsub(req.url, "^/images/(.*)", "\1");
+    }
+
     # This uses the ACL action called "purge". Basically if a request to
     # PURGE the cache comes from anywhere other than localhost, ignore it.
     if (req.method == "PURGE") {
@@ -19,16 +24,7 @@
             return (synth(405, "This IP is not allowed to send PURGE 
requests."));
         }
 
-        if (xkey.purge(regsub(req.url, "^/(.*)", "\1")) != 0) {
-            return (synth(200, "Purged"));
-        } else {
-            return (synth(404, "Key not found"));
-        }
-    }
-
-    # Swift expects /lang/project/foo
-    if (req.url ~ "^/images/") {
-        set req.url = "/wiki/dev/" + regsub(req.url, "^/images/(.*)", "\1");
+        return(hash);
     }
 
     # Reject any methods that aren't expected to work in the context of 
thumbnails

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I892fb7b296226e8f8a49ec4be399acfc0431132a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Gilles <gdu...@wikimedia.org>

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

Reply via email to