<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 7, 2016 at 2:01 PM, Debraj Manna <span dir="ltr"><<a href="mailto:subharaj.manna@gmail.com" target="_blank">subharaj.manna@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi,<br><br></div>I have a response in which <span style="font-family:monospace,monospace">no-store</span> is set. But varnish is still caching the response for default 2 mins.<br>(..)</div>By <span style="font-family:monospace,monospace">vcl_backend_response</span> looks something like below:-<br><br><span style="font-family:monospace,monospace"><font size="1">sub vcl_backend_response {<br>    if (bereq.url ~ "^/rde_server/") {<br>       set beresp.ttl = 300s;<br>       return(deliver);<br>    }<br>    if(beresp.http.Cache-Control ~ "no-store|no-cache") {<br>       return(deliver);<br>    }<br>    unset beresp.http.Cache-Control;<br>}</font><br></span><br></div>Can some one let me know what is going wrong or I have to do some special handling in vcl so that varnish does not cache the response with <span style="font-family:monospace,monospace">no-store</span> set in <span style="font-family:monospace,monospace">Cache-Control</span>?<br></div></blockquote><div><br></div><div>You are using the wrong action. return(deliver) doesn't mark the object as uncacheable. It only marks it as OK for delivery to the client.</div><div><br></div><div>Do something like this:</div><div><br>if(beresp.http.Cache-Control ~ "no-store|no-cache") {<br>   set beresp.ttl = 120s;<br>   set beresp.uncacheable = true;<br>   (..)</div><div><br></div><div><br>This will create a hit-for-pass object to stop serialised access to the URL and <br></div></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><table border="0" cellpadding="0" cellspacing="0" style="border-bottom-width:1px;padding-top:5px;border-top-style:solid;width:550px;padding-bottom:5px;border-bottom-color:rgb(238,238,238);border-top-width:1px;border-bottom-style:solid;line-height:1.5em;border-top-color:rgb(238,238,238);color:rgb(102,102,102);font-size:12px;font-family:'Helvetica Neue',Arial,sans-serif;margin-top:20px"><tbody><tr><td width="100"><img src="http://www.varnish-software.com/static/media/logo-email.png"></td><td><font color="#222222"><span style="font-size:14px"><b>Per Buer</b></span></font><br>CTO | Varnish Software AS<br>Cell: <a value="+4790181750" style="color:rgb(17,85,204)">+47 95839117</a><br><span style="font-weight:bold">We Make Websites Fly!<br><a href="https://www.varnish-software.com/" style="color:rgb(17,85,204)" target="_blank">www.varnish-software.com</a></span></td></tr></tbody></table><br><div style="color:rgb(136,136,136)"><a href="http://info.varnish-software.com/signature" target="_blank"><img src="http://files.varnish-software.com/signature.png"></a><br></div></div></div></div></div>
</div></div>