[prev in list] [next in list] [prev in thread] [next in thread] 

List:       varnish-misc
Subject:    Help debugging cacheability / ttl information?
From:       denis () startsiden ! no (=?utf-8?Q?Denis_Br=C3=A6khus?=)
Date:       2008-01-31 13:17:22
Message-ID: 17076163.9291201785442139.JavaMail.root () ms1 ! startsiden ! no
[Download RAW message or body]

Hi,

We have a setup with varnish in front of a lighttpd+fastcgi combo. For some reason or \
other the application doesn't send any cache control headers. Instead of doing the \
sensible thing (prodding the developers to fix it in the backend) I have taken it \
upon myself to fix it via VCL. 

However my feeble attempts at being smart have so far failed elegantly, and I am left \
scratching my head a bit.

What I really am looking for is some help with how to best debug the setup with \
regards to TTLs and cacheability. I'd like to be able to inspect a specific cached \
objects TTL to see if my "set obj.ttl" overrides actually work or not. What is the \
best way to do that? 

On the client I use firebug, so all headers and responess are readily available on \
that end. The reason I don't think everything is as it should is that the Age header \
is very low most of the time.

For the record we are still at varnish 1.0.4 and here is the current VCL (I've taken \
out the stuff that was obviously not working anyway) :

"
backend default {
        set backend.host = "127.0.0.1";
        set backend.port = "80";
}

sub vcl_recv {
    if (req.request == "GET" && req.http.cookie) {
        lookup;
    }
    if (req.request == "GET" && req.url ~ "\.(gif|jpg|swf|css|js)$") {
        lookup;
    }
}

sub vcl_fetch {
    if (obj.ttl < 120s) {
        set obj.ttl = 120s;
    }
    if (resp.http.Set-Cookie) {
        insert;
    }
}
"

Any help will be highly appreciated!

Regards
--
Denis


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic