wont server from Cache

vitaly burshteyn vburshteyn at gmail.com
Tue Jun 1 18:39:38 CEST 2010


Hi folks,

 So for last few days i have been trying to get my varnish box to server
files from cache, and not having much luck.  Even though its telling me it
is hitting the cache its not delivering files from it, since when i shut
down the appache i get 503 errors.


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





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.";}

            return(lookup);}





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

           {return(lookup);}





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

           {purge_url(req.url);}



return(lookup);



}





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)

            {return(pass);}

        if (beresp.http.Set-Cookie)

            {return(pass);}

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


More information about the varnish-misc mailing list