Squid is an old, working-horse, caching proxy server that can be configurated to act as a reverse proxy. Varnish is the opposite, it’s an extremely fast http accellerator that’s configurated to be, well, just that. So I thought, just for the fun of it, what about configurating Varnish to cache the Internet for me, that is, use it as a general forwarding caching proxy server.
Obviously, we can’t define varnish backends for the entire world. But Squid can do that. So I used our corporate Squid proxy, and put a local varnish cache in front of it. The vcl is very simple:
backend default { # This is squidbox .host = "11.22.33.44"; .port = "3128"; }
That’s it, actually. Start up varnish, and use that varnish instance’s address and http port as proxy in your web browser.
Then, using an ugly little perl script “proxytest” for testing, we found these quite interesting results:
$ for i in "" squidbox:3128 varnishbox:6081; do ./proxytest $i http://www.slashdot.org/ 10; done 1.0836112s 0.3773585s 0.0352446s
Lesson learned: Varnish is some 10 times faster than Squid, when caching the Internet!
With thanks to eric for playing with settings.