Definition

A web cache is a hardware device or software application for temporarily storing frequently-accessed static content.

Diagram of how a web cache works

Overview

Internet users with similar interests often download the same web content over and over again. Without a proper web cache, every time a user makes a request the response must come all the way from the origin server (part of the “Internet” in the illustration above). When many users are requesting content at the same time, response times may increase and a server overload may even occur.

A web cache handles requests for popular content that would otherwise be directed to the origin server. It also puts popular content closer to end users, thereby improving response times. One popular type of web cache is a CDN.

How a Web Cache Works

Whenever content is downloaded from the origin server, a copy is stored in the web cache for a set period of time determined by caching rules you set. If another user requests the same content again, the web cache sends the stored content and the user request does not have to be forwarded to origin server again. This is known as content caching.

A typical web cache flow looks like this:

  1. A user accesses a website.
  2. The browser sends an HTTP request to the web cache.
  3. If the requested object IS stored in the cache, the web cache responds with the object.

    If the requested object IS NOT stored in the cache, the web cache requests the object from the origin server and sends the response to the browser.
  4. If the object is cacheable, the web cache retains a copy of the object so that subsequent requests are served locally from the web cache.

Example of a Web Cache

Teachers and students of Harare International School (HIS) needed fast Internet to research and communicate effectively. But they were challenged by the expensive and limited bandwidth for the school’s 700+ connected devices. At $6000 per month for an 8Mbps Internet connection, the school ruled out a bandwidth upgrade. Instead they opted for a web caching solution.

The web cache appliance was used in conjunction with a Cisco router. The router redirects the web traffic while the device keeps a copy of all videos, images, and other static content. Caching the content enabled the school to have significant improvements in web performance without spending more on bandwidth. This was especially useful during back-to-back group lessons when students had to access the same content.

Conclusion

The increased use of websites and web applications demands higher bandwidth and server resources. However, organizations can still continue providing high Internet performance levels without increasing operational costs. This requires storing frequently-accessed web content and serving it locally.

A hardware- or software-based web cache placed between the users and web servers reduces bandwidth requirements, server load, and latency. This frees up resources while improving performance for users.