Gilles has uploaded a new change for review.

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

Change subject: Set thumbnails varnish TTL to 90 days
......................................................................

Set thumbnails varnish TTL to 90 days

In order to verify whether or not we could have a single caching layer
for thumbnails, we can use the existing setup with Varnish to see if
a longer TTL for thumbnails could achieve an acceptable hit ratio.

Bug: T77697
Change-Id: I19e20046e251e1a0959396c2bbd20c2a80d35dbd
---
M templates/varnish/upload-backend.inc.vcl.erb
1 file changed, 7 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/58/218858/1

diff --git a/templates/varnish/upload-backend.inc.vcl.erb 
b/templates/varnish/upload-backend.inc.vcl.erb
index 349d958..7d819a2 100644
--- a/templates/varnish/upload-backend.inc.vcl.erb
+++ b/templates/varnish/upload-backend.inc.vcl.erb
@@ -56,7 +56,7 @@
                                "^/(score)/(.+)$",
                                "/swift/v1/global-data-\1-render/\2");
                }
-               
+
                if (bereq.url ~ "^/swift/v1/") {
                        set bereq.http.host = "ms-fe.eqiad.wmnet";
                }
@@ -104,7 +104,11 @@
 sub vcl_fetch {
        // Cache media objects for 30 days by default
        if (beresp.status <= 400) {
-               set beresp.ttl = 30d;
+               if (req.url ~ 
"^/+[^/]+/[^/]+/thumb/[^/]+/[^/]+/[^/]+/[0-9]+px-") {
+                       set beresp.ttl = 90d;
+               } else {
+                       set beresp.ttl = 30d;
+               }
        }
 
        // Stream large objects, >= 1 MB
@@ -118,7 +122,7 @@
        } else {
                call pick_main_stevedore;
        }
-       
+
        if (beresp.http.Content-Range) {
                // Varnish itself doesn't ask for ranges, so this must have been
                // a passed range request

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

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

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

Reply via email to