O'Reilly logo

Professional Website Performance: Optimizing the Front-End and Back-End by Peter Smith

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2

Utilizing Client-Side Caching

WHAT’S IN THIS CHAPTER?

  • Discovering the different types of caches and proxies
  • Learning how to encourage browsers to cache your contents
  • Learning how browsers cache 301 redirects
  • Understanding DNS caching and prefetching in the major browsers

Caching is an important part of the modern Internet, but it is also an issue surrounded by a lot of confusion and misunderstanding. The issue is so significant that many web masters see caching as their enemy and spend copious amounts of time trying to force content not to be cached. As you shall see, though, caching is a significant concept to ensure the smooth flow of the web, and web masters would do well to embrace it.

UNDERSTANDING THE TYPES OF CACHING

Caching is a somewhat broad term, but generally refers to the storage of web resources (HTML documents, images, and so on) in a temporary location to improve performance. Caches can be implemented by most web browsers, perimeter (intermediate) web proxies, and at the gateways of large internal networks. Transparent proxies (caches) are used by many Internet Service Providers (ISPs), reverse proxies sit in front of web servers, and the web server itself utilizes caching.

To understand caching, let’s take a closer look at each of these scenarios.

Caching by Browsers

Most web browsers implement a cache (an area of disk on which previously retrieved resources can be temporarily stored) to hold recently and frequently accessed resources. This makes perfect ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required