req.hash and fetch

Henry Paulissen h.paulissen at qbell.nl
Fri Nov 27 15:53:22 CET 2009


Hey all,

 

 

One of my website has more only the request url who are unique. Content
inside the website depends on the url you request (.com|.co.uk|etc) and the
browser language. So at first request we set a cookie with the language
preferences (so we don't have to check it every time).

 

Inside varnish I made the following:

@vcl_recv: 

set req.http.X-match = regsub(req.http.Cookie,
"^.*(langpref=[a-z]+_[a-z]+).*$", "\1");

 

@vcl_hash: 

set req.hash += req.url;

set req.hash += req.http.X-match;

 

 

Does varnish need more settings (in vcl_fetch?) to store the parsed backend
request with the proper hash key?

 

 

Reagards.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20091127/cb2ea925/attachment-0002.html>


More information about the varnish-misc mailing list