O'Reilly logo

Instant PageSpeed Optimization by Sanjeev Jaiswal

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

Rules for using the CSS, JavaScript, and image files (Simple)

There are many other ways to enhance web response, which can't fit any of those listed recipes appropriately, so we will discuss such possibilities in this recipe.

How to do it...

We may accomplish it by performing the following steps:

  1. Using external files for stylesheets and JavaScript: This not only saves bandwidth and loads faster, but helps in caching those files too, which would be impossible if we made it inline.
  2. Using correct order of stylesheets, scripts, and inline JavaScript code: This will save a lot of download time and make web response even faster.
  3. Don't scale images in HTML: Scaling images into smaller ones never helps you to reduce the download size or reduce the file size, ...

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