O'Reilly logo

Responsive Web Design with jQuery by Gilberto Crespo

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

Making fewer HTTP requests

Decreasing the number of components included on a page reduces the number of HTTP requests required to load the website and it is not related to the number of KBs of each file only. There is also a problem that refers to the short time for which each HTTP connection is consumed by servers processing each request before delivering the file back to the browser.

We will see some techniques to achieve reduction in the number of requests:

  • Using conditional loaders
  • Combining multiple scripts into one script
  • Combining multiple CSS files into one stylesheet
  • Using CSS Sprites

Using conditional loaders

Conditional loaders such as RequireJS or yepnope.js, which we have talked about earlier in the book, will only load code that is required. ...

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