What to do when the backend sends no caching information?

Per Buer perbu at linpro.no
Fri Dec 12 22:52:11 CET 2008


Hi,

If you have a look at the default VCL you'll see that varnish does a
pass when the object is not cacheable (see man vcl again) or if it Sets
a cookie. I think you have to override this manually, both in vcl_fetch
and in vcl_recv.

Per.

Alecs Henry wrote:
> Hi Per,
> 
> I'm actually using the cookies in the cache (using the information
> provided on the website -- set req.hash += req.http.cookie;) and it
> works just fine!
> One thing that the backend does is vary on user-agent, not only
> content-encoding (I've removed the UA vary on the response, though).
> 
> So looking into varnishlog I can see the pass, even after the hash is
> shown correctly.
> 
> Any pointers?
> 
> THanks!
> 
> Alecs
> 
> On Fri, Dec 12, 2008 at 7:21 PM, Per Buer <perbu at linpro.no
> <mailto:perbu at linpro.no>> wrote:
> 
>     Hi,
> 
>     Alecs Henry wrote:
>     >
>     > Well, turns out varnish may be setting the ttl all right (I do it in
>     > vcl_fetch, but frankly there really is no way to see if it is set
>     > correctly or not! or is there?) but the page always gets a PASS,
>     never a
>     > HIT. Age: is set to 0 by varnish.
> 
>     The client probably sends a cookie. When varnish sees a cookie it does a
>     pass. Please see the FAQ on notes on how to deal with this.
> 
>     Per.
> 
>     --
>     http://linpro.no/ | http://redpill.se/
> 
> 


-- 
Per Buer - Leder Infrastruktur og Drift - Redpill Linpro
Telefon: 21 54 41 21 - Mobil: 958 39 117
http://linpro.no/ | http://redpill.se/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20081212/d0822a80/attachment-0003.pgp>


More information about the varnish-misc mailing list