Library Table of Contents Index Previous Next Comments

Optimizing a Web site for caching

Headers in HTTP 1.1  Top

HTTP 1.1 allows for explicit control of content through HTTP headers (which is not possible with HTTP 1.0). By configuring HTTP headers on your Web server, you can influence how content is handled by proxy-cache servers. In general, current proxy-cache servers do not cache content if the content does not include appropriate headers. (NetCache includes controls you can use to prevent content from being cached even if an HTTP 1.1 header indicates it is cacheable; for example, you can prevent caching of a specific content type.)

Static and dynamic content and cacheability  Top

Because content cacheability is decided entirely by the HTTP headers that are returned in the response from the origin server, whether the content is static or dynamic is irrelevant for determining cacheability.

Static content

The majority of bytes (typically, 60 percent or greater) from Web sites are static (for example, images and Java applets). Although the HTML might be generated again for every request, many items within the page might be cached.

Dynamic content

Much content that is generated dynamically by a server (for example, database queries) is valid for some period of time and, therefore, should be cacheable. Typically, it is straightforward to design the server so that dynamic content can be cached. For example, a script that queries a database can send an explicit expiration header (usually after a Content-Type header) with the response. Some content must always be retrieved from the origin server, for example, bid prices for an online auction. (In the case of bid prices for an online auction, an appropriate Cache-Control header should indicate this fact.)

Making a URL cacheable even for only a short period can have a dramatic effect on the network. For example, if a particular URL is requested 100 times per minute, making this content cacheable for one minute could remove 99 percent of the load from the origin server if an accelerator is being used.

For additional information  Top

For detailed information about optimizing your Web site for Web caching services, see "Caching Tutorial for Web Authors and Webmasters" at http://www.mnot.net/cache_docs. For example, this information includes recommendations for using cookies only when necessary, minimizing the use of SSL, and using consistent references to the same objects.

Library Table of Contents Index Previous Next Comments