caching problem

Sridhar sridhar at primesoftsolutionsinc.com
Thu Aug 13 07:46:28 CEST 2009


Hi All,

 

I have setup the plone site behind varnish and pound.

 

I observe in consistency in cache hits. If I look the varnishstats, its not
displaying any cache hits.

 

Previously it use to disaply.

 

Here is my config

 

 

#

# This is a basic VCL configuration file for varnish.  See the vcl(7)

# man page for details on VCL syntax and semantics.

#

# $Id: default.vcl 1424 2007-05-15 19:38:56Z des $

#

 

# Default backend definition.  Set this to point to your content

# server.

 

backend default {

        set backend.host = "x.x.x.x";

        set backend.port = "8080";

}

 

acl purge {

        "localhost";

        "x.x.x.x"/24;

}

 

sub vcl_hash {

    set req.hash += req.http.cookie;

 

if (req.request == "GET" && req.http.cookie) {

                lookup;

        }

        lookup;

}

 

sub vcl_recv {

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

                # PURGE request if zope asks nicely

                if (req.request == "PURGE") {

                        if (!client.ip ~ purge) {

                                error 405 "Not allowed.";

                        }

                        lookup;

                }

                pipe;

        }

        if (req.http.Expect) {

                pipe;

        }

if (req.http.Authenticate || req.http.Authorization) {

                pass;

        }

        # We only care about the "__ac.*" cookies, used for authentication

        if (req.http.Cookie && req.http.Cookie ~
"__ac(|_(name|password|persistent))=") {

                pass;

        }

        lookup;

}

 

# Do the PURGE thing

sub vcl_hit {

        if (req.request == "PURGE") {

                set obj.ttl = 0s;

                error 200 "Purged";

        }

}

sub vcl_miss {

        if (req.request == "PURGE") {

                error 404 "Not in cache";

        }

}

 

# Enforce a minimum TTL, since we PURGE changed objects actively from Zope.

#sub vcl_fetch {

#        if (obj.ttl < 3600s) {

#                set obj.ttl = 3600s;

#        }

#}

 

# Below is a commented-out copy of the default VCL logic.  If you

# redefine any of these subroutines, the built-in logic will be

# appended to your code.

 

## Called when a client request is received

#

#sub vcl_recv {

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

#               pipe;

#       }

#       if (req.http.Expect) {

#               pipe;

#       if (req.http.Expect) {

#               pipe;

#       }

#       if (req.http.Authenticate || req.http.Cookie) {

#               pass;

#       }

#       lookup;

#}

#

## Called when entering pipe mode

#

#sub vcl_pipe {

#       pipe;

#}

#

## Called when entering pass mode

#

#sub vcl_pass {

#       pass;

#}

#

## Called when entering an object into the cache

#

#sub vcl_hash {

#       hash;

#}

#

## Called when the requested object was found in the cache

#

#sub vcl_hit {

#       if (!obj.cacheable) {

#               pass;

#       }

#       deliver;

#}

#

## Called when the requested object was not found in the cache

#sub vcl_miss {

#       fetch;

#}

#

## Called when the requested object has been retrieved from the

## backend, or the request to the backend has failed

#

sub vcl_fetch {

        if (!obj.valid) {

                error;

        }

        if (!obj.cacheable) {

                pass;

        }

#       if (resp.http.Set-Cookie) {

#               pass;

#       }

#       insert;

}

#

## Called when an object nears its expiry time

#

#sub vcl_timeout {

#       discard;

#}

 

Please help me, I am struggling from long time to solve this problem.

 

I use firefox and I.E browsers.

 

Regards,

Sridhar Raju

PrimeSoft Solutions Inc



Phone: 040-27762986/27762987

Skype ID: sridharsagi

www.primesoftsolutionsinc.com <http://www.primesoftsolutionsinc.com/> 

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20090813/a31c7525/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 2699 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20090813/a31c7525/attachment-0003.gif>


More information about the varnish-misc mailing list