Hi!
I am trying to configure varnish to avoid caching some specific http
statuses sent from the backend. Since I can't control 100% the headers they
are sending, I should do it in varnish as they all go through it.
What I came with is:

sub vcl_fetch {
    if (obj.status == 404 || obj.status == 503 || obj.status == 500) {
        set obj.http.Cache-Control = "max-age=0";
        return (pass);
    }
    return (deliver);
}

But when I try to run varnish it complains about not being able to compile
vcl:

Message from VCC-compiler:
Variable 'obj.status' not accessible in method 'vcl_fetch'.
At: (input Line 80 Pos 9)
    if (obj.status == 404 || obj.status == 503 || obj.status == 500) {
--------##########----------------------------------------------------
Running VCC-compiler failed, exit 1
VCL compilation failed


I saw in the documentation that obj.status is valid.
What I am doing wrong?

I am using varnish-2.1.3

Thanks!

Jonathan
_______________________________________________
varnish-misc mailing list
[email protected]
http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Reply via email to