caching everything incl. 403?

Tollef Fog Heen tfheen at linpro.no
Tue Dec 16 16:42:59 CET 2008


]] "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



More information about the varnish-misc mailing list