Chapter 7. Caching

Web caches are HTTP devices that automatically keep copies of popular documents. When a web request arrives at a cache, if a local “cached” copy is available, the document is served from the local storage instead of from the origin server. Caches have the following benefits:

  • Caches reduce redundant data transfers, saving you money in network charges.

  • Caches reduce network bottlenecks. Pages load faster without more bandwidth.

  • Caches reduce demand on origin servers. Servers reply faster and avoid overload.

  • Caches reduce distance delays, because pages load slower from farther away.

In this chapter, we explain how caches improve performance and reduce cost, how to measure their effectiveness, and where to place caches to maximize impact. We also explain how HTTP keeps cached copies fresh and how caches interact with other caches and servers.

Get HTTP: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.