{"id":2098,"date":"2015-02-12T16:11:16","date_gmt":"2015-02-12T16:11:16","guid":{"rendered":"http:\/\/blog.designed79.co.uk\/?p=2098"},"modified":"2015-02-12T16:11:16","modified_gmt":"2015-02-12T16:11:16","slug":"increase-varnish-ttl-on-cache","status":"publish","type":"post","link":"https:\/\/blog.designed79.co.uk\/?p=2098","title":{"rendered":"Increase Varnish TTL on cache"},"content":{"rendered":"<p>Overriding the time-to-live (ttl)<br \/>\nSometimes your backend will misbehave. It might, depending on your setup, be easier to override the ttl in Varnish than to fix your somewhat cumbersome backend.<\/p>\n<p>You need VCL to identify the objects you want and then you set the beresp.ttl to whatever you want:<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"text codecolorer\">sub vcl_fetch {<br \/>\n&nbsp; &nbsp; if (req.url ~ &quot;^\/legacy_broken_cms\/&quot;) {<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; set beresp.ttl = 5d;<br \/>\n&nbsp; &nbsp; }<br \/>\n}<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Overriding the time-to-live (ttl) Sometimes your backend will misbehave. It might, depending on your setup, be easier to override the ttl in [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2098","post","type-post","status-publish","format-standard","hentry","category-info-on-tech"],"_links":{"self":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2098","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2098"}],"version-history":[{"count":0,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2098\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2098"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2098"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2098"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}