Hi,

It doesn't work :/

sub vcl_fetch {
                
        /* Set NON-200 caching */
        if (obj.status != 200)
        {
                set obj.cacheable = "1";
                set obj.ttl = 300s;
        }
        [...]

Error-Message:

Expected ID got '"1"'
(program line 290), at
(/etc/varnish/default.vcl Line 20 Pos 37)
                set obj.cacheable = "1";
------------------------------------###-

VCL compilation failed

Any idea?

--neil

-----Ursprüngliche Nachricht-----
Von: [email protected] 
[mailto:[email protected]] Im Auftrag von Tollef Fog Heen
Gesendet: Dienstag, 16. Dezember 2008 16:43
An: [email protected]
Betreff: Re: caching everything incl. 403?

]] "Loesche, Lukas, scoyo" 

| Also, what criteria has to be meet for if(obj.cacheable) to be true?

from bin/varnishd/rfc2616.c:

        switch (sp->obj->response) {
        case 200: /* OK */
        case 203: /* Non-Authoritative Information */
        case 300: /* Multiple Choices */
        case 301: /* Moved Permanently */
        case 302: /* Moved Temporarily */
        case 410: /* Gone */
        case 404: /* Not Found */
                sp->obj->cacheable = 1;
                [...]
        default:
                sp->obj->cacheable = 0;

In other words, by default it'll be marked as non-cacheable. You should
be able to do something like:

if (obj.status == 403) {
   set obj.cacheable = 1;
}

in your VCL.

-- 
Tollef Fog Heen 
Redpill Linpro -- Changing the game!
t: +47 21 54 41 73
_______________________________________________
varnish-misc mailing list
[email protected]
http://projects.linpro.no/mailman/listinfo/varnish-misc
_______________________________________________
varnish-misc mailing list
[email protected]
http://projects.linpro.no/mailman/listinfo/varnish-misc

Reply via email to