Tip of the Trade: Squid

Monday Jun 2nd 2008 by Carla Schroder

Share:

Visitors to your Web site don't care about exotic database backends or fancy scripting tricks. They just don't want to die of old age waiting for your pages to load. Turbocharge your Web servers (and eliminate this issue) with Squid.

The Squid HTTP caching proxy is an old favorite for speeding up Web surfing. Set up a Squid proxy on your network, and users will see faster response times while you experience lower bandwidth usage.

Squid is easy to set up as a simple HTTP proxy, plus it has a number of useful advanced functions, such as simple traffic shaping and access controls. You can also use Squid in reverse to improve the performance of your own Web servers. This makes it usable as both a reverse proxy and an HTTP accelerator.

This works in the same way  the Squid proxy caches requests from site visitors and serves them up instead of hitting the Web server every time. Some estimates claim as much as 35 percent savings in bandwidth. A single Squid proxy can serve several Web servers. In this era of complex dynamic Web sites, the World Wide Wait seems longer than ever, even with widespread broadband. Let's face it, site visitors don't care about exotic database backends or fancy scripting tricks; they just don't want to die of old age waiting for pages to load.

Squid can't cache dynamic content like ASP pages or CGI scripts. But even insanely dynamic sites have a lot of cache-able objects, such as images and static pages. A Squid reverse proxy can also perform load balancing, and it adds a useful layer of security. It supports virtual domains, and a single Squid proxy can control which requests go to which backend servers. Squid also supports password-protected pages and ensures logins are directed to the correct server.

In addition to configuring Squid, you'll also have to configure DNS and probably some firewall rules as well. Visit Squid-cache.org for thorough documentation and help.