From the course: Developing for Web Performance

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Browser caching

Browser caching

- [Instructor] Every file the browser receives in response to a request will be stored by the browser in its cache for later retrieval. This ensures you don't have to re-download the style sheet and JavaScript and images and everything else every time you navigate to a page you've already visited. You can control the caching of all of these assets on your site to either prolong or shorten the time an asset is cached, depending on your needs. The recommendation is to try to cache assets in the user's browser for as long as possible unless you have a good reason not to. In most server configurations, you can specify the caching strategy for individual file types. In the server config examples provided by the HTML5 Boilerplate Team, you can get Boilerplate code for all of this as in this example for Nginx. Here, you can see we have a list of all the different file types. We have default caching length, we have no content…

Contents