Introduction

In this lesson, we will learn how to install and configure squid as a proxy cache server. First, the role of squid will be explained. The next section will give a brief tutorial how to install, configure and maintain squid server.

What Is Squid?

In general, A proxy cache server can serve roles as proxy, caching and NAT (Network Address Translation). However, Squid only support roles as proxy and caching server. Additionally, squid can serve as HTTPD Accelerator and do data filtering.

 

As a proxy server, squid acts on behave client applications such as browser and passing their request to target server. Squid also do caching, that is storing the returned result from the target server on its local storage.

Squid’s real benefit emerges when the same data is requested multiple times, and a copy of the on-disk data is returned to the client, speeding up Internet access, and saving bandwidth. In principle, squid uses amount of local disk space to improve bandwidth usage and browsing speed.

 

Squid can also be configured as a httpd accelerator or so called reverse proxy server. If a squid is configured a httpd accelerator for a web site, then it acts as the original remote web server in perspective of client application (browser). Every http request that supposed to be send to the original web server will be received and replied by squid instead.

In this lesson, we also covered how to filter data that go through squid proxy server. The configuration for filtering data will be covered  in the last subsection.

Proxy Server vs Firewall

Squid, which is a proxy server, is different from a firewall server. While firewalls usually have a proxy component, they do not store copies of the returned data; they must re-fetch requested data from the target server for every client's requests.


Besides, squid support more protocols and can work on layer 7 (Application) on OSI models, while firewall proxies often support only a specific protocols and work on layer 3 (Network) and 4 (Transport) layers.

A cache server, like squid, associates every items stored on its local disk as object. Web pages usually consist of graphics, sound files which are of big sizes. They are stored as objects in a cache server. In general, different pages can link to a same graphics file, and requesting those pages via proxy server do not need really to re-fetch the graphics file from the remote server.

To ensure the result returning to client applications are always up-to-date, each cached object have refresh time. If an object has expired, the subsequent request link to that object will force squid to re-fetch it from the remote server.