A few users see a blank page

Dag-Erling Smørgrav des at linpro.no
Thu Feb 14 12:02:23 CET 2008


"Marco Molinari" <marco.molinari at gmail.com> writes:
> backend default {
>        set backend.host = "127.0.0.1";
>        set backend.port = "8080";
> }

You didn't say which version you're using, but from this backend
definition, it's certainly not trunk.  It would be very helpful to
know whether you see the same behaviour with trunk.

>        if (req.http.Pragma == "no-cache") {
>                pipe;
>        }

Are you sure you want to do this?

If the point of this is to allow the client to Shift-Reload, you
should purge the URL to force a reload from the backend, instead of
piping the request.

If you are certain that this is what you want, you should use pass
instead of pipe.

If you are absolutely certain that you want to use pipe, you should
add "Connection: close" to the request so that subsequent requests
will go through Varnish.

>        if (req.request == "GET" && req.url ~ "\.(gif|jpg|swf|css|js|swf|flv|png|jpeg)$") {
>                lookup;
>        }

You should strip cookies before lookup.

>        if (req.request != "GET" && req.request != "HEAD") {
>                pipe;
>        }

Varnish can handle POST in pass mode.

In any case, this should be at the top; otherwise, requests you want
piped may be caught earlier and sent to pass or lookup.

>        if (req.http.Expect) {
>                pipe;
>        }

You really want pass here, not pipe.

> Today I changed the last "pass" into "pipe" (in the req.http.Cookie
> part) and both I and my complaining users get no blank pages anymore
> (Arne, I remember you wrote you tried both pipe and pass, but did you
> try this?)
>
> To sum this up, I get a blank page if all of these happen:
> - I use a Squid 2.5 or 2.6 proxy
> - and the content is generated by php
> - and the content is more than 8000 bytes
> - and the cookie header is quite long (about 500 chars)
> - and if (req.http.Cookie) {pass} in vcl

I'm sorry, but the logs you posted show that the backend did not send
any content for the second request.

If you think otherwise, you'll have to provide a tcpdump.

DES
-- 
Dag-Erling Smørgrav
Senior Software Developer
Linpro AS - www.linpro.no



More information about the varnish-misc mailing list