Improving Responses

Improving Responses

Improving Response Times

  • Reduce the number of components to reduce the number of HTTP requests to render the page
    • Combine all scripts into a single script
    • Combine all CSS into a single stylesheet
  • Use a Content Delivery Network to locate static content close to end users
  • Add an Expires or a Cache-Control Header
  • Reduce DNS lookups and reverse DNS lookups
  • Avoid using redirects and add a trailing slash (/) to URLs that should have one to avoid the resultant redirects
  • Configure Entity tags (ETags)

Image Guidelines

  • Use image maps to combine multiple images into a single image
  • Block Image Leeching
  • Avoid inline linking to images and other remote resources

CSS Guidelines

  • Place stylesheets in the HEAD so pages can render progressively
  • Use CSS Sprites to reduce the number of image requests
  • Avoid CSS expressions because they were deprecated starting with IE8
  • Place CSS in external files so thy are cached by the browser
  • Minify CSS files
  • Add small images as inline images in your CSS files so they get cached
  • Use an Object Oriented CSS approach

Javascript Guidelines

  • Place scripts at the bottom of pages because they block parallel downloads
  • Place JavaScript in external files so thy are cached by the browser
  • Minify JavaScript files
  • Locate and remove duplicate scripts

Sources