Varnish 4 Not Obeying no-store

Tobias Honacker t.honacker at googlemail.com
Thu Jan 7 14:28:54 CET 2016


You have to add beresp.uncacheable. Try this:

--snip--

    if(beresp.http.Cache-Control ~ "no-store|no-cache") {
         set beresp.uncacheable = true;
        set beresp.ttl = 120s;
       return(deliver);
    }

--snap--

2016-01-07 14:01 GMT+01:00 Debraj Manna <subharaj.manna at gmail.com>:

> Hi,
>
> I have a response in which no-store is set. But varnish is still caching
> the response for default 2 mins.
>
> root at SPk-D-0534:/var/log# curl -i "localhost:8080"
> HTTP/1.1 200 OK
> Cache-Control: no-store
> Date: Thu, 07 Jan 2016 12:59:38 GMT
> Content-Length: 22
> Content-Type: text/plain; charset=utf-8
> X-Varnish: 32777 32775
> Age: 5
> Via: 1.1 varnish-v4
> Accept-Ranges: bytes
> Connection: keep-alive
>
> Hello World No Cached
>
>
> By vcl_backend_response looks something like below:-
>
> sub vcl_backend_response {
>     if (bereq.url ~ "^/rde_server/") {
>        set beresp.ttl = 300s;
>        return(deliver);
>     }
>     if(beresp.http.Cache-Control ~ "no-store|no-cache") {
>        return(deliver);
>     }
>     unset beresp.http.Cache-Control;
> }
>
> 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 no-store
> set in Cache-Control?
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20160107/38def971/attachment.html>


More information about the varnish-misc mailing list