<div dir="ltr">You have to add beresp.uncacheable. Try this:<div><br></div><div>--snip--</div><div><br></div><div><span style="font-family:monospace,monospace;font-size:x-small">    if(beresp.http.Cache-Control ~ "no-store|no-cache") {</span></div><div>      <font face="monospace, monospace">   <font size="1">set beresp.uncacheable = true;</font></font><div><font face="monospace, monospace" size="1">        set beresp.ttl = 120s;</font></div><span style="font-family:monospace,monospace;font-size:x-small">       return(deliver);</span><br style="font-family:monospace,monospace;font-size:x-small"><span style="font-family:monospace,monospace;font-size:x-small">    }</span><br></div><div><span style="font-family:monospace,monospace;font-size:x-small"><br></span></div><div><font face="arial, helvetica, sans-serif">--snap--</font></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-01-07 14:01 GMT+01:00 Debraj Manna <span dir="ltr"><<a href="mailto:subharaj.manna@gmail.com" target="_blank">subharaj.manna@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc 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><br><font size="1"><span style="font-family:monospace,monospace">root@SPk-D-0534:/var/log# curl -i "localhost:8080"<br>HTTP/1.1 200 OK<br>Cache-Control: no-store<br>Date: Thu, 07 Jan 2016 12:59:38 GMT<br>Content-Length: 22<br>Content-Type: text/plain; charset=utf-8<br>X-Varnish: 32777 32775<br>Age: 5<br>Via: 1.1 varnish-v4<br>Accept-Ranges: bytes<br>Connection: keep-alive<br><br>Hello World No Cached<br></span></font><br><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>
<br>_______________________________________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a><br>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" rel="noreferrer" target="_blank">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a><br></blockquote></div><br></div>