Most of my web career has been spent as a backend engineer.As such, I dutifully
approached each performance project as an exercise in backend optimization, concentrating
on compiler options, database indexes, memory management, etc.There셲
a lot of attention and many books devoted to optimizing performance in these areas,
so that셲 where most people spend time looking for improvements.In reality, for
most web pages, less than 1020% of the end user response time is spent getting the
HTML document from the web server to the browser.If you want to dramatically
reduce the response times of your web pages, you have to focus on the other 8090%
of the end user experience.What is that 8090% spent on? How can it be reduced?
The chapters that follow lay the groundwork for understanding today셲 web pages
and provide 14 rules for making them faster.

Tracking Web Page Performance
In order to know what to improve, we need to know where the user spends her time
waiting.Figure A-1 shows the HTTP traffic when Yahoo!셲 home page (http://www.
yahoo.com) is downloaded using Internet Explorer.Each bar is one HTTP request.
The first bar, labeled html, is the initial request for the HTML document.The
browser parses the HTML and starts downloading the components in the page.In
this case, the browser셲 cache was empty, so all of the components had to be downloaded.
The HTML document is only 5% of the total response time.The user spends
most of the other 95% waiting for the components to download; she also spends a
small amount of time waiting for HTML, scripts, and stylesheets to be parsed, as
shown by the blank gaps between downloads.
The Performance Golden Rule
This phenomenon of spending only 1020% of the response time downloading the
HTML document is not isolated to Yahoo!셲 home page.This statistic holds true for
all of the Yahoo! properties I셶e analyzed (except for Yahoo! Search because of the
small number of components in the page).Furthermore, this statistic is true across
most web sites.Table A-1 shows 10 top U.S.web sites extracted from http://www.
alexa.com.Note that all of these except AOL were in the top 10 U.S.web sites.
Craigslist.org was in the top 10, but its pages have little to no images, scripts, and
stylesheets, and thus was a poor example to use.So, I chose to include AOL in its
place.

Table A-1. Percentage of time spent downloading the HTML document for 10 top web sites
Empty cache Primed cache
AOL 6% 14%
Amazon 18% 14%
CNN 19% 8%
eBay 2% 8%
Google 14% 36%
MSN 3% 5%
MySpace 4% 14%
Wikipedia 20% 12%
Yahoo! 5% 12%
YouTube 3% 5%
Share