proxy uses If-Modified-Since messages to check on its freshness. Choosing ∆T invariably
involves some kind of heuristic, depending on how long ago the page was last modified.
Web pages containing dynamic content (e.g., generated by a PHP script) should never be
cached since the parameters may be different next time. To handle this and other cases, there
is a general mechanism for a server to instruct all proxies along the path back to the client not
to use the current page again without verifying its freshness. This mechanism can also be used
for any page expected to change quickly. A variety of other cache control mechanisms are also
defined in RFC 2616.
Yet another approach to improving performance is proactive caching. When a proxy fetches a
page from a server, it can inspect the page to see if there are any hyperlinks on it. If so, it can
issue requests to the relevant servers to preload the cache with the pages pointed to, just in
case they are needed. This technique may reduce access time on subsequent requests, but it
may also flood the communication lines with pages that are never needed.
Clearly, Web caching is far from trivial. A lot more can be said about it. In fact, entire books
have been written about it, for example (Rabinovich and Spatscheck, 2002; and Wessels,
2001); But it is time for us to move on to the next topic.
Server Replication
Caching is a client-side technique for improving performance, but server-side techniques also
exist. The most common approach that servers take to improve performance is to replicate
their contents at multiple, widely-separated locations. This technique is sometimes called
mirroring.
A typical use of mirroring is for a company's main Web page to contain a few images along
with links for, say, the company's Eastern, Western, Northern, and Southern regional Web
sites. The user then clicks on the nearest one to get to that server. From then on, all requests
go to the server selected.
Mirrored sites are generally completely static. The company decides where it wants to place
the mirrors, arranges for a server in each region, and puts more or less the full content at each
location (possibly omitting the snow blowers from the Miami site and the beach blankets from
the Anchorage site). The choice of sites generally remains stable for months or years.
Unfortunately, the Web has a phenomenon known as
flash crowds in which a Web site that
was previously an unknown, unvisited, backwater all of a sudden becomes the center of the
known universe. For example, until Nov. 6, 2000, the Florida Secretary of State's Web site,
www.dos.state.fl.us, was quietly providing minutes of the meetings of the Florida State cabinet
and instructions on how to become a notary in Florida. But on Nov. 7, 2000, when the U.S.
Presidency suddenly hinged on a few thousand disputed votes in a handful of Florida counties,
it became one of the top five Web sites in the world. Needless to say, it could not handle the
load and nearly died trying.
What is needed is a way for a Web site that suddenly notices a massive increase in traffic to
automatically clone itself at as many locations as needed and keep those sites operational until
the storm passes, at which time it shuts many or all of them down. To have this ability, a site
needs an agreement in advance with some company that owns many hosting sites, saying that
it can create replicas on demand and pay for the capacity it actually uses.
An even more flexible strategy is to create dynamic replicas on a per-page basis depending on
where the traffic is coming from. Some research on this topic is reported in (Pierre et al.,
2001; and Pierre et al., 2002).