Mark Bergsma has uploaded a new change for review. https://gerrit.wikimedia.org/r/55556
Change subject: Let Varnish logic set TTL on 4xx, but cap at a configured TTL ...................................................................... Let Varnish logic set TTL on 4xx, but cap at a configured TTL Change-Id: I82ee313e967efd94f07ef26e19ad36915dbc4a57 --- M templates/varnish/wikimedia.vcl.erb 1 file changed, 2 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/56/55556/1 diff --git a/templates/varnish/wikimedia.vcl.erb b/templates/varnish/wikimedia.vcl.erb index 7cf5d0f..b4718ba 100644 --- a/templates/varnish/wikimedia.vcl.erb +++ b/templates/varnish/wikimedia.vcl.erb @@ -213,13 +213,8 @@ return(restart); } <% end -%> - if (beresp.status >= 400) { -<% if vcl_config.fetch("cache4xx", "0") == "0" -%> - set beresp.ttl = 30s; - return(hit_for_pass); -<% else -%> - set beresp.ttl = <%= vcl_config.fetch("cache4xx", "5m") %>; -<% end -%> + if (beresp.status >= 400 && beresp.ttl > <%= vcl_config.fetch("cache4xx", "5m") %>) { + set beresp.ttl = <%= vcl_config.fetch("cache4xx", "5m") %>; } /* Function vcl_fetch in <%= vcl %>.inc.vcl will be appended here */ -- To view, visit https://gerrit.wikimedia.org/r/55556 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I82ee313e967efd94f07ef26e19ad36915dbc4a57 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Mark Bergsma <m...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits