caching of restarted requests possible?

Łukasz Barszcz / Gadu-Gadu l.barszcz at gadu-gadu.pl
Wed Mar 2 08:13:30 CET 2011


Hi,

On 02.03.2011 00:13, Hauke Lampe wrote:
> I'd like to cache the 404 response for some time and immediately lookup the object under the next backend's hash key, so the update backend is only queried again after the TTL of the 404 object expires.
>
> I figure that even if varnish would cache the request before restart, it would probably not go through vcl_fetch next time. I tried setting a magic header in vcl_fetch and restart the request in vcl_deliver. varnish didn't like that and died with "INCOMPLETE AT: cnt_deliver(196)"
Check out patch attached to ticket 
http://varnish-cache.org/trac/ticket/412 which changes behavior to what 
you need.

> Is there any way to remember the previous request status on restart and use it for backend selection in vcl_recv?
You can store data custom header in req, like req.http.X-My-State. req.* 
is accessible from every function in vcl, so you can store your state in 
there - it persists across restarts.

-- 
Łukasz Barszcz
web architect / Pion Aplikacji Internetowych

GG Network S.A
ul. Kamionkowska 45
03-812 Warszawa
tel.: +48 22 514 64 99
fax.: +48 22 514 64 98
gg:16210

Spółka zarejestrowana w Sądzie Rejonowym dla m. st. Warszawy, XIII
Wydział Gospodarczy KRS pod numerem 0000264575, NIP 867-19-48-977.
Kapitał zakładowy:  1 758 461,10 zł - wpłacony w całości.





More information about the varnish-misc mailing list