Chapter 6.  Configuring Servers to Work with Caches

This chapter is intended as a guide for web server administrators. I offer some techniques and advice on how to make your server friendly to web caches.

HTTP—Version 1.1 in particular—provides a number of headers for the exchange of information between origin servers and caches. For one reason or another, servers often fail to include these headers in their responses. This is rather unfortunate, because it can lead to undesirable or even incorrect behavior. The absence of these headers gives caches a lot of freedom to determine whether and for how long a given response may be cached. In particular, we are interested in the Date, Last-modified, Expires, Cache-control, and Content-length headers. You have already been introduced to these HTTP headers in Chapter 2, but we will explore them in greater detail here.

As a server administrator, you may be forced to choose between control on one hand and performance on the other. Uncachable objects give you more control and accurate access counts. Cachable responses take away some of your control but give better performance to your viewers. I will argue that your servers should be as cache-friendly as possible. This means carefully identifying which pages can be cached and which cannot. Cachable pages should include expiration times in keeping with their update frequency.

You will also find information here on how to configure your server to be cache-unfriendly. Essentially, this means ...

Get Web Caching now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.