wont server from Cache

Caunter, Stefan scaunter at topscms.com
Fri Oct 1 15:15:00 CEST 2010

Assuming your cache is hot enough, you should be able to keep things
going with this in recv


  if (req.backend.healthy) {

                set req.grace = 60s;

        } else {

                set req.grace = 4h;



If your backends all go away, grace is what saves you, but you need the
cache to be well heated.


Stefan Caunter :: Senior Systems Administrator :: TOPS

e: scaunter at topscms.com  ::  m: (416) 561-4871

www.thestar.com www.topscms.com


From: varnish-misc-bounces at varnish-cache.org
[mailto:varnish-misc-bounces at varnish-cache.org] On Behalf Of Vitaly
Sent: June-01-10 12:28 PM
To: varnish-misc at varnish-cache.org
Subject: wont server from Cache


Hi folks,


So I sent this post few days ago, I have made some changes but still
cant get my varnish box to server content from cache even though it
looks like it is:

232  Client requests received

         130  Cache hits

           5  Cache hits for pass

          97  Cache misses

          99  Backend conn. success

           3  Backend conn. failures

          99  Fetch with Length

          15  N struct sess_mem



When I shut down the web server it gives me a 503 error.


Here is the copy of my vcl file with out the backend info..  Any and all
suggestion would be appreciated.



sub vcl_recv {


#set req.backend = bw;

set req.grace = 60m;


if (req.request == "PURGE")

            {if (!client.ip ~ purge)

                {error 405 "Not allowed.";}




if (req.request != "GET" && req.request != "HEAD")




   if (req.http.Cache-Control ~ "no-cache")








sub vcl_hit {


  if (!obj.cacheable) {

      return(pass);  }}


sub vcl_fetch {

    if (beresp.status == 500 || beresp.status == 503 || beresp.status ==
504) {

            restart;    }


        set beresp.ttl = 600s;

        set beresp.grace = 600s;


        if (beresp.ttl < 300s) {

          set beresp.ttl = 300s;}

        if (!beresp.cacheable)


        if (beresp.http.Set-Cookie)




Vitaly Burshteyn

Senior Network Engineer

Broadway.com, Theatre Direct International

729  7th Avenue

New York, New York 10019

Phone: 212.817.9117

Cell# 917-701-5732


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20101001/f5c50638/attachment-0003.html>

More information about the varnish-misc mailing list