
varnish-bugs at varnish-cache
Aug 19, 2011, 8:59 AM
Post #1 of 3
(166 views)
Permalink
|
|
#984: [PATCH] When a non-cacheable status is returned, default TTL is applied
|
|
#984: [PATCH] When a non-cacheable status is returned, default TTL is applied ---------------------+------------------------------------------------------ Reporter: drwilco | Type: defect Status: new | Priority: normal Milestone: | Component: varnishd Version: trunk | Severity: normal Keywords: | ---------------------+------------------------------------------------------ In cache_center.c: {{{ sp->wrk->exp.ttl = RFC2616_Ttl(sp); }}} In RFC2616_Ttl: {{{ ttl = params->default_ttl; }}} ... {{{ switch (sp->err_code) { default: sp->wrk->exp.ttl = -1.; break; case 200: /* OK */ case 203: /* Non-Authoritative Information */ case 300: /* Multiple Choices */ case 301: /* Moved Permanently */ case 302: /* Moved Temporarily */ case 307: /* Temporary Redirect */ case 410: /* Gone */ case 404: /* Not Found */ }}} ... {{{ return (ttl); }}} So even though RFC2616_Ttl sets sp->wrk->exp.ttl to -1, the return(ttl) at the end overwrites that through the assignment in cache_center.c of the return value. So anything that's not a 200, 203, 300, 301, 302, 307, 410 or 404 will get the default TTL instead of -1. -- Ticket URL: <http://varnish-cache.org/trac/ticket/984> Varnish <http://varnish-cache.org/> The Varnish HTTP Accelerator _______________________________________________ varnish-bugs mailing list varnish-bugs [at] varnish-cache https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
|