Alex Monk has uploaded a new change for review.

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

Change subject: varnish: Fix upload backend support for versions other than 4
......................................................................

varnish: Fix upload backend support for versions other than 4

Bug: T147116
Change-Id: I71200f0f0a5a4501108eea8c09a570237bec6e58
---
M modules/varnish/templates/upload-backend.inc.vcl.erb
1 file changed, 11 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/68/313668/1

diff --git a/modules/varnish/templates/upload-backend.inc.vcl.erb 
b/modules/varnish/templates/upload-backend.inc.vcl.erb
index c320022..28a37f3 100644
--- a/modules/varnish/templates/upload-backend.inc.vcl.erb
+++ b/modules/varnish/templates/upload-backend.inc.vcl.erb
@@ -5,24 +5,29 @@
        // Select a storage size class/bin
         // See T145661 for storage binning rationale
        if (beresp.http.Content-Length !~ "^[0-9]+$") { // even possible on 
upload?
-               set beresp.storage_hint = "bin1";
+               set beresp.<%= @storage_hint_storage -%> = "bin1";
        }
        elsif (std.integer(beresp.http.Content-Length, 0) < 1024 * 16) { // 16KB
-               set beresp.storage_hint = "bin0";
+               set beresp.<%= @storage_hint_storage -%> = "bin0";
        }
        elsif (std.integer(beresp.http.Content-Length, 0) < 1024 * 16 * 16) { 
// 256KB
-               set beresp.storage_hint = "bin1";
+               set beresp.<%= @storage_hint_storage -%> = "bin1";
        }
        elsif (std.integer(beresp.http.Content-Length, 0) < 1024 * 16 * 16 * 
16) { // 4MB
-               set beresp.storage_hint = "bin2";
+               set beresp.<%= @storage_hint_storage -%> = "bin2";
        }
        elsif (std.integer(beresp.http.Content-Length, 0) < 1024 * 16 * 16 * 16 
* 16) { // 64MB
-               set beresp.storage_hint = "bin3";
+               set beresp.<%= @storage_hint_storage -%> = "bin3";
        }
        else { // >= 64MB
-               set beresp.storage_hint = "bin4";
+               set beresp.<%= @storage_hint_storage -%> = "bin4";
                if (std.integer(beresp.http.Content-Length, 0) >= 1024 * 16 * 
16 * 16 * 16 * 16) { // 1GB
+                       <%- if @varnish_version4 -%>
                        set beresp.uncacheable = true;
+                       return (deliver);
+                       <%- else -%>
+                       return (hit_for_pass);
+                       <%- end -%>
                }
        }
 }

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

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

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

Reply via email to