In my previous article 7 Easy-to-Apply Tips to Improve Your Web Site Performance, I described methods to achieve better client-side performance.  The conclusion of the article was: “The most important and effective way to improve web site performance is to make fewer HTTP Requests.”

Since browsers only are able to download two components on parallel per hostname, and every HTTP request has an average round-trip latency of 0.2 seconds, that causes a 2 second latency alone, if the site is loading 20 items, regardless of whether they are style sheets, images or scripts. (On an average broadband connection with a browser capable of downloading two components at a time).

Since browsers spend approximately 80% of the time fetching external components such as scripts, style sheets and images. Reducing the number of HTTP requests has the biggest impact on improving website performance. Moreover, it is the easiest way to make a performance improvement.

This article focuses on ways of minimizing HTTP Requests to maximize web site performance.

1. Image Maps


Image Maps are used to combine multiple images into a single image and specify regions to assign a specific action to each region. The overall size is about the same, but reducing the number of HTTP requests speeds up the page.

There are two types of image maps:

    Client-side: When a user activates a region of a client-side image map with a mouse, the pixel coordinates are interpreted by the user agent. The user agent selects a link that was specified for the activated region and follows it.

    Server-side:
When a user activates a region of a server-side image map with a mouse, the pixel coordinates of the click are sent to the server-side agent specified by the href attribute of the A element. The server-side agent interprets the coordinates and performs some action.

Client-side image maps are preferred over server-side image maps for at least two reasons: they are accessible to people browsing with non-graphical user agents and they offer immediate feedback as to whether or not the pointer is over an active region.

For details: Image Maps

The main navigation of bloggingdeveloper.com utilizes image maps. If you examine the source of this page, you will see the following code:

<img src="/themes/BD/images/menuimg.gif" border="0"
        usemap="#Map" id="imgMenu" />
<map name="Map" id="Map">
  <area shape="rect"
        coords="4,31,82,58"
        href="/"
        alt="Blogging Developer Home" />
  <area shape="rect"
        coords="88,25,189,57"
        href="/archive.aspx"
        alt="Archive" />
  <area shape="rect"
        coords="197,26,307,53"
        href="/contact.aspx"
        alt="Contact Blogging Developer" />
  <area shape="rect"
        coords="315,25,379,52"
        href="/syndication.axd?format=rss"
        alt="Blogging Developer RSS Feed" />
</map>

2. CSS Sprites


Another method for reducing the number of image requests is combining images into a single image and using CSS background-image and background-position properties to display the desired image part.

You may find detailed information about CSS sprites in CSS Sprites: Image Slicing’s Kiss of Death.

Bloggingdeveloper.com utilizes CSS Sprites on the rating stars.

3. Combine External Script/StyleSheet Files into a Single File


Number of HTTP requests may be reduced by combining all scripts into a single script and similarly combining all external stylesheets into a single stylesheet.

While combining external files reduces the HTTP requests, it hardens the maintenance of these files. However, combining these files as a part of build process is a good practice. Moreover, if you have variety of pages that use a different set of scripts and stylesheets, you should not combine them into a one big file which is inefficient since the page downloads more JS and CSS than it needs.

Conclusions:


If you want to improve your site’s performance, reducing the number of HTTP requests in your page is the first place to start. This is the most important guideline for improving performance.

Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Currently rated 3.5 by 17 people

  • Currently 3.470588/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5




Add comment





(will not be displayed)








  • javascript
  • querystring
  • url parameters
  • parse querystring
  • delayed redirect
  • settimeout
  • focus
  • textbox
  • page load
  • after submit
  • set focus in asp.net 2.0/3.5
  • on page load
  • after postback
  • set control focus
  • postback
  • asp.net 1.x
  • substring
  • substr
  • javascript string methods
  • parsefloat
  • convert strings to numbers
  • parseint
  • javascript history
  • history.go
  • history.back
  • http requests
  • image maps
  • css sprites
  • external css
  • external javascript
  • compress javascript
  • javascript compression
  • ajaxcontroltoolkit
  • tab control
  • array
  • length
  • javascipt
  • lastmodified
  • mstsc
  • terminal services
  • remote desktop connections
  • null
  • undefined
  • array.join
  • string concatenation
  • setinterval
  • clearinterval
  • timing events
  • cleartimeout
  • javascript timing events
  • url redirection
  • location.href
  • location.replace
  • redirect
  • redirection
  • system.io.compression
  • viewstate compression
  • compress viewstate
  • gzipstream
  • loadpagestatefrompersistencemedium
  • savepagestatetopersistencemedium
  • form spam
  • captcha
  • prevent spam without captcha
  • url redirect
  • defaultbutton
  • enter key
  • default button
  • asp.net
  • 2.0
  • form
  • panel
  • 1.1
  • form submit
  • dopostback
  • onkeypress
  • onkeydown
  • onkeyup
  • javascript key events
  • keycode 13
  • disable enter key
  • int32.parse
  • convert.toint32
  • int32.tryparse
  • google
  • hoax
  • gmail
  • storage
  • counter
  • mail
  • visual studio 2005
  • vs 2008
  • copy
  • paste
  • clipboard data
  • static variables
  • application object
  • static property
  • server control
  • web file manager
  • iz web file manager
  • convert
  • parse
  • tryparse
  • file upload control
  • maxrequestlength
  • executiontimeout
  • httpruntime
  • asp.net 2.0
  • registering scripts
  • registerclientscript
  • registerstartupscript
  • cross-browser
  • events
  • improve web site performance
  • compression
  • caching
  • elmah
  • error logging
  • exception
  • error
  • httphandler
  • google sitemap generator
  • sitemap
  • internet information services
  • iis7
  • hosts file
  • localhost
  • windows vista
  • search engine optimization
  • seo
  • search engine friendly pages
  • headscriptmanager
  • class library
  • head
  • css
  • c#
  • iis
  • internet information services manager
  • 401.3 unauthorized
  • 500.0 internal server error
  • http error 500.19
  • google toolbar
  • yellow input fields
  • input
  • select
  • background color
  • mozilla firefox
  • medium trust
  • orcas
  • compileroptions
  • warninglevel
  • zyb
  • mobile phones
  • online backup service
  • online services
  • textarea
  • maxlength
  • limit input length
  • custom server control
  • internal error 2739
  • adobe cs3
  • adobe customer support
  • solution
  • error code 0x80004005
  • 500.19 internal server error
  • meta tags
  • keywords meta tag
  • meta
  • description meta tag
  • fake page rank domains
  • scammers
  • google page rank technology
  • ebay
  • general
  • title
  • page rank