Community day

At the eZ Winter Conference 2010, meet up with the community in Geneva, jan. 21st.
Register and read more here.

Using the Squid Reverse Proxy to Improve eZ Publish Performance

Squid is an Open Source proxy application that can also be used as a reverse proxy. The difference between a proxy and a reverse proxy is that a proxy delivers content from multiple webservers to one user, while a reverse proxy delivers content from one webserver to multiple users. For example, a normal proxy might be used to provide a degree of anonymity to a user or to access servers that would otherwise be blocked; the proxy would access many other servers on the user's behalf. On the other hand, one of the reasons for using a reverse proxy is to speed up the delivery of content to all visitors of a particular server. This article shows how to use Squid with eZ Publish to improve the performance of your website.

Squid overview

Squid is an application that caches HTTP requests, subsequently serving the same request more quickly. When requests are served from the cache, the webserver does not have to expend resources to regenerate pages, transfer images, and so on. Squid stores XHTML pages, images, CSS files, JavaScript and other data transmitted over HTTP via the proxy as long as the data is configured as cacheable by the application (eZ Publish in this case). With eZ Publish you can cache the following:

  • Complete pages by using the header override features (available in eZ Publish 3.8 and greater)
  • Static files such as CSS and JavaScript
  • Database content such as images, media and binary files

The diagram below shows an example architecture using Squid.

An example architecture using Squid

Squid resides on a separate server in front of the eZ Publish webserver(s). The Squid server caches the user HTTP requests, speeding up the serving of pages and files and also lowering the load on the eZ Publish server. With Squid, many requests are only sent through to the webserver the first time. Subsequently, they are intercepted and served by Squid until the requested item's cache expires. (Cache expiry will be discussed later in this article.) This frees up resources for unique or dynamic requests that need processing by the webserver. If you are running eZ Publish in a clustered environment, Squid should reside in front of the load balancer. This is the simplest setup and allows you to cache all servers at the same time.

Latest comments

No comments yet!

You must be logged in to post comments.

Bård Farstad

Software engineer from Buskerud University College and has an degree in electronics. He is one of the three founders of eZ Systems and one of the initiators of eZ Publish. As VP of Business Development, his focus is on creating and commercializing current and new products. In his spare time he plays the guitar and bass and plays with his two daughters.

Powered by eZ Publish® Content Management System. Copyright © 2009 eZ Systems AS (except where otherwise noted). All rights reserved.