Caching same object twice for different browsers

Flavio Torres fla_torres at yahoo.com.br
Wed Jul 13 16:21:50 CEST 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/13/2011 11:09 AM, Lars Jørgensen wrote:
> I suspect I need to normalize some of the request headers, but which
> of them and how?

Hello Lars,

We are using the following vcl (varnish 2.1):

sub vcl_hash {

        if (req.http.user-agent ~ "iPhone|SymbianOS") {
                set req.hash += req.http.user-agent;
        }
        else {
                remove req.http.user-agent;
        }

        set req.hash += req.url;
        set req.hash += req.http.host;

        return (hash);
}


Hope this helps.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk4dqfgACgkQNRQApncg296jHACgo1TjX5/mlyaCJNqTGFN3xEng
nBAAnRjtp3OSc3UJO8+P26EGMe++pkoM
=he75
-----END PGP SIGNATURE-----





More information about the varnish-misc mailing list