Thank you for the help!<br><br>Quick question:<br><br>for this block<br><br><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">if (req.url ~ "/blah"){</span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> set beresp.ttl = 300s;</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> <b>unset req.http.set-cookie;</b></span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> set beresp.http.cache-control = "public, max-age = 300";</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> set beresp.http.X-CacheReason = "Blah";</span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> return(deliver);</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">}</span></p><p class="MsoNormal"><br><span style="font-size: 11pt; color: rgb(31, 73, 125);"></span></p><p class="MsoNormal"><br><span style="font-size: 11pt; color: rgb(31, 73, 125);"></span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">I thought it was unset beresp.http.set-cookie;</span></p><p class="MsoNormal"><br><span style="font-size: 11pt; color: rgb(31, 73, 125);"></span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Is there a difference?</span></p><p class="MsoNormal"><br><span style="font-size: 11pt; color: rgb(31, 73, 125);"></span></p><p class="MsoNormal">
<br><span style="font-size: 11pt; color: rgb(31, 73, 125);"></span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Thanks again.<br></span></p><br><br><div class="gmail_quote">On Thu, Feb 10, 2011 at 4:16 PM, Caunter, Stefan <span dir="ltr"><<a href="mailto:scaunter@topscms.com">scaunter@topscms.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div link="blue" vlink="purple" lang="EN-CA"><div><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">You need in vcl_recv:</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">if (req.url ~ “/blah”){</span></p><p class="MsoNormal">
<span style="font-size: 11pt; color: rgb(31, 73, 125);"> unset req.http.cookie;</span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> return(lookup);</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">}</span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">else {</span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> return(pass);</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">}</span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Setting 360s for beresp.ttl gets you 6 minutes </span><span style="font-size: 11pt; font-family: Wingdings; color: rgb(31, 73, 125);">J</span><span style="font-size: 11pt; color: rgb(31, 73, 125);"></span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Resetting it to 360 if it goes under 120 seems odd.</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Use something like this in vcl_fetch:</span></p><p class="MsoNormal">
<span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">if (req.url ~ "/blah"){</span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> set beresp.ttl = 300s;</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> unset req.http.set-cookie;</span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> set beresp.http.cache-control = "public, max-age = 300";</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> set beresp.http.X-CacheReason = "Blah";</span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> return(deliver);</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">}</span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Stefan Caunter </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Operations</span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Torstar Digital</span></p><p class="MsoNormal">
<span style="font-size: 11pt; color: rgb(31, 73, 125);">m: (416) 561-4871</span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0cm 0cm;"><p class="MsoNormal"><b><span style="font-size: 10pt;" lang="EN-US">From:</span></b><span style="font-size: 10pt;" lang="EN-US"> <a href="mailto:varnish-misc-bounces@varnish-cache.org" target="_blank">varnish-misc-bounces@varnish-cache.org</a> [mailto:<a href="mailto:varnish-misc-bounces@varnish-cache.org" target="_blank">varnish-misc-bounces@varnish-cache.org</a>] <b>On Behalf Of </b>Mike Franon<br>
<b>Sent:</b> February-10-11 3:51 PM<br><b>To:</b> <a href="mailto:varnish-misc@varnish-cache.org" target="_blank">varnish-misc@varnish-cache.org</a><br><b>Subject:</b> varnish 2.15 - default set to cache nothing except two urls?</span></p>
</div><div><div></div><div class="h5"><p class="MsoNormal"> </p><div><p class="MsoNormal">HI,</p></div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">I am fairly new to varnish, and was curious, is there a way to have all traffic go through varnish to the backend without caching unless for specific pages. For example we only want two pages to be cached, our home, and a specific page under the home as seen below?</p>
</div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">Here is my default.vcl </p></div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">Thanks</p></div><div><p class="MsoNormal"> </p></div><div>
<p class="MsoNormal"> </p></div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">backend default {</p></div><div><p class="MsoNormal"> .host = "127.0.0.1"; </p></div><div><p class="MsoNormal"> .port = "80";</p>
</div><div><p class="MsoNormal">}</p></div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">sub vcl_recv {</p></div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">
# for the default home page</p></div><div><p class="MsoNormal"> if (req.url ~ "^/") {</p></div><div><p class="MsoNormal"> unset req.http.cookie;</p></div><div><p class="MsoNormal"> }</p></div><div>
<p class="MsoNormal"> </p></div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal"> # if they go directly to /samplepage</p></div><div><p class="MsoNormal"> if (req.url ~ "^/samplepage") {</p>
</div><div><p class="MsoNormal"> unset req.http.cookie;</p></div><div><p class="MsoNormal"> }</p></div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">}</p></div><div><p class="MsoNormal"> </p></div>
<div><p class="MsoNormal">sub vcl_fetch {</p></div><div><p class="MsoNormal"> if (req.url ~ "^/") {</p></div><div><p class="MsoNormal"> unset beresp.http.set-cookie;</p></div><div><p class="MsoNormal">
}</p></div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal"> if (req.url ~ "^/samplepage") {</p></div><div><p class="MsoNormal"> unset beresp.http.set-cookie;</p></div><div><p class="MsoNormal">
}</p></div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal"> #override cache headers from backend to keep element in cache for 5 minutes</p></div><div><p class="MsoNormal">
if (beresp.ttl < 120s) {</p></div><div><p class="MsoNormal"> set beresp.ttl = 360s;</p></div><div><p class="MsoNormal"> }</p></div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">}</p></div></div>
</div></div></div></blockquote></div><br>