<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Learning the World &#187; tenni theurer</title>
	<atom:link href="http://learningtheworld.eu/tag/tenni-theurer/feed/" rel="self" type="application/rss+xml" />
	<link>http://learningtheworld.eu</link>
	<description></description>
	<lastBuildDate>Tue, 06 Nov 2012 00:17:33 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.1</generator>
	<item>
		<title>Website Performance Tweaks, Part Two</title>
		<link>http://learningtheworld.eu/2007/performance-2/</link>
		<comments>http://learningtheworld.eu/2007/performance-2/#comments</comments>
		<pubDate>Sun, 24 Jun 2007 14:20:19 +0000</pubDate>
		<dc:creator><![CDATA[Martin Kliehm]]></dc:creator>
				<category><![CDATA[conferences]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[@media]]></category>
		<category><![CDATA[atmedia]]></category>
		<category><![CDATA[atmedia07]]></category>
		<category><![CDATA[atmedia2007]]></category>
		<category><![CDATA[book:ean=9780596529307]]></category>
		<category><![CDATA[book:isbn=0596529309]]></category>
		<category><![CDATA[cdn]]></category>
		<category><![CDATA[cpu]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[energy efficiency]]></category>
		<category><![CDATA[etag]]></category>
		<category><![CDATA[expires header]]></category>
		<category><![CDATA[gzip]]></category>
		<category><![CDATA[http-request]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Nate Koechley]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[steve souders]]></category>
		<category><![CDATA[tenni theurer]]></category>
		<category><![CDATA[yahoo]]></category>
		<category><![CDATA[yslow]]></category>
		<category><![CDATA[yui]]></category>

		<guid isPermaLink="false">http://learningtheworld.eu/2007/performance-2/</guid>
		<description><![CDATA[Nate Koechley presented the research results of the Yahoo! Exceptional Performance Team two weeks ago in London. The traditional focus of <strong>performance optimization</strong> has been on the backend, i.e. system efficiency. But comparing a number of high profile websites, the Yahoo! team found that frontend performance is responsible for 80-98% of the perceived response time. Therefore doubling the frontend performance gains more than doubling the backend performance. [&#8230;]]]></description>
				<content:encoded><![CDATA[<p class="vcard"><a href="http://www.flickr.com/photos/drewm/538822354/in/set-72157600330136671/" title="See larger version on flickr"><img alt="Nate Koechley" src="/wp-content/uploads/2007/07/nate-koechley" width="240" height="160" class="floatleft photo" /></a> <strong><a href="http://nate.koechley.com" class="fn url" rel="co-worker met acquaintance">Nate Koechley</a></strong> presented the <a href="http://nate.koechley.com/blog/2007/06/12/high-performance-web-sites">research results</a> of the Yahoo! Exceptional Performance Team two weeks ago in London (<a href="http://www.htmldog.com/atmedia2007/highperformancewebpages.mp3" type="audio/mp3">podcast</a>). Like Yahoo! shares I would like to share that knowledge with you for those who couldn&rsquo;t attend.</p>

<p>The traditional focus of <strong>performance optimization</strong> has been on the backend, i.e. system efficiency. But comparing a number of high profile websites, the Yahoo! team found that frontend performance is responsible for 80-98% of the perceived response time. Therefore doubling the frontend performance gains more than doubling the backend performance. In case studies <em>Yahoo! Search</em> became 40-50% faster, the <em>Yahoo! Mail</em> web application gained 70-100%. Of course there are ways to increase backend performance without throwing in more hardware, but better frontend performance reduces traffic and saves resources.</p>

<p>Saving resources on the <em>client</em> side, particularly <strong>CPU usage</strong>, also pays off in speed. <a href="http://icant.co.uk/sandbox/eventdelegation/">Event delegation</a> is faster than a large number of event handlers. Likewise we know that <a href="/2007/performance/">reducing the number of HTTP requests</a> through techniques like CSS sprites, sliding doors, or file aggregation increases speed. The reason is the limit of two parallel requests <em>per host</em> imposed by HTTP 1.1. That results in a download queue of two requests at a time, increasing the perceived response time of a page. By configuring additional host aliases for your server you can <a href="http://yuiblog.com/blog/2007/04/11/performance-research-part-4/">increase the number of parallel requests</a>&nbsp;&mdash; but more than 2-4 also increase DNS lookups resulting in higher CPU usage and slower response times.</p>

<p>I wonder when Yahoo! will present us another impressive calculation <strong>how many gigawatts have been preserved</strong> by reducing CPU usage in client PCs and in their <a href="http://www.technewsworld.com/story/55792.html" title="Study: Data Center Power Usage Exploding">data</a> <a href="http://brand.yahoo.com/forgood/environment/energy_conservation.html" title="Yahoo! Energy Conservation Program">centers</a>, as one participant asked in the <acronym title="questions and answers">Q&amp;A</acronym> part. <a href="http://www.ecologee.net">Energy efficient servers</a> are the next big thing, but are there any concrete suggestions for <a href="http://www.addsimplicity.com/adding_simplicity_an_engi/2007/01/compute_power_i.html">greener programming</a>? Is <acronym title="Asynchronous JavaScript and XML">AJAX</acronym> destroying the ozone layer? <img src="http://learningtheworld.eu/wp-includes/images/smilies/icon_wink.gif" alt=";)" class="wp-smiley" /> </p>

<p>Environmental issues aside, here&rsquo;s the <strong><a href="http://developer.yahoo.com/performance/rules.html">list of rules</a></strong>. I&rsquo;ll keep it short where I have written about it in <a href="/2007/performance/">my previous article</a>. See the <a href="http://stevesouders.com/hpws/">examples and testcases</a> by Steve Souders.</p>

<ol>
<li id="rule-1"><strong>Make <a href="/2007/performance/">fewer HTTP requests</a>:</strong> This also affects <a href="http://yuiblog.com/blog/2007/03/01/performance-research-part-3/">cookies</a>. Eliminate unnecessary cookies, keep them small, set them at granular domain levels (e.g. <code>finance.yahoo.com</code> instead of <code>.yahoo.com</code>), and set an appropriate Expires date.</li>
<li id="rule-2"><strong>Use a content distribution network (<acronym>CDN</acronym>)</strong> like <a href="http://www.akamai.com">Akamai</a> where your (static) content is served from distributed data centers located nearer to your client. Even if your website is not as big as Google you can profit from faster response times by using the <a href="http://yuiblog.com/blog/2007/02/22/free-yui-hosting"><acronym title="Yahoo! User Interface">YUI</acronym> library&rsquo;s own <acronym>CDN</acronym></a>.</li>
<li id="rule-3"><strong>Add an Expires header</strong> not just <a href="/2007/performance/#enforce-caching" title="Enforce image caching">for images</a>, but also for JavaScript and stylesheet files.</li>
<li id="rule-4"><strong>Enable gzip:</strong> 90%+ of browsers support compression, and <code>gzip</code> is better supported and compresses more than <code>deflate</code>. Gzip <acronym title="Hypertext Markup Language">HTML</acronym> files, <acronym title="Cascading Stylesheets">CSS</acronym>, scripts, <acronym title="Extensible Markup Language">XML</acronym>, <acronym title="JavaScript Object Literal Notation">JSON</acronym>&nbsp;&mdash; <em>no</em> images or <acronym title="Portable Data Format">PDF</acronym>s.</li>
<li id="rule-5"><strong>Put <acronym>CSS</acronym> at the top</strong>, avoid <code>@import</code> as it loads <em>last</em>, even <em>after</em> the images!</li>
<li id="rule-6"><strong>Move scripts to the bottom</strong> as they block parallel downloads even across hostnames and block rendering of any code below them.</li>
<li id="rule-7"><strong>Avoid <acronym>CSS</acronym> expressions</strong> as they execute many times and cost CPU.</li>
<li id="rule-8">
<p><strong>Use external JavaScript and <acronym>CSS</acronym> files.</strong> <a href="/2007/performance/#inline-css">Inline <acronym>CSS</acronym></a> is apparently faster for a user&rsquo;s start page, but not on subsequent pages. After the page has finished loading, use the time to <strong>preload scripts</strong> to speed up secondary pages.</p>
<ol class="code">
<li><code>window.onload = downloadComponents;</code></li>
<li><code>function downloadComponents() {</code></li>
<li class="indent"><code>var elem = document.createElement(&quot;script&quot;);</code></li>
<li class="indent"><code>elem.src = &quot;http://.../file1.js&quot;;</code></li>
<li class="indent"><code>document.body.appendChild(elem);</code></li>
<li><code>}</code></li>
</ol></li>
<li id="rule-9"><strong>Reduce <acronym title="Domain Name Server">DNS</acronym> lookups</strong> for the reasons stated above. Use 1-4 hosts and the <code>keep alive</code> setting.</li>
<li id="rule-10"><strong><a href="/2007/performance/#file-aggregation">Minify JavaScript</a></strong> with JSMin&nbsp;&mdash; inline scripts, too.</li>
<li id="rule-11"><strong>Avoid redirects</strong> as they are the worst form of blocking. Set Expires headers for redirects to enable caching.</li>
<li id="rule-12"><strong>Remove duplicate files:</strong> this is self-explanatory, but it can happen in large teams with many scripts and stylesheets.</li>
<li id="rule-13"><p><strong>Mind the <acronym title="Entity Tag">ETag</acronym>:</strong> Now this was something I never paid attention to. ETags are unique identifiers to distinguish files that share a <acronym title="Uniform Resource Identifier">URI</acronym>. They are transmitted in the HTTP header. The default server setting uses the <a href="http://en.wikipedia.org/wiki/Inode">INode</a>, the bytesize and the modification date of a file to calculate a unique ID. Unless servers in a cluster are identical, ETags differ, therefore the files are <strong>not cached</strong>. Fortunately <a href="http://httpd.apache.org/docs/2.0/mod/core.html#fileetag">ETags can be configured</a> in Apache, so it should be possible to match them across different servers.</p><ol class="code"><li><code>FileETag MTime Size</code></li></ol>
<p>Note that the ETag is also <strong>relevant for <acronym title="Really Simple Syndication">RSS</acronym> feeds</strong>. For example, currently the <a href="http://www.w3.org/2004/08/TalkFiles/Talks.rss" type="application/rss+xml"><acronym title="World Wide Web Consortium">W3C</acronym> talks feed</a> is more or less unusable: some feed readers and services apparently regard the ETag, the feed is mirrored on many servers, so the same news entry from a different server is shown as new and unread multiple times every day&hellip;</p>
</li>
<li id="rule-14"><strong>Make <acronym title="Asynchronous JavaScript and XML">AJAX</acronym> cacheable and small</strong>. Some data like a user&rsquo;s address book or buddy list change infrequently and should be requested via GET, cached, and set with a <code>Last-modified</code> timestamp and gzipped.</li>
</ol>

<p><img src="/wp-content/uploads/2007/06/book-high-performance-web-sites" alt="Book cover: High Performance Web Sites" width="120" height="158" class="floatleft book" /> These are a lot of rules, and they will be published in a O&rsquo;Reilly book by Steve Souders and Tenni Theurer in September 2007. Anyway, don&rsquo;t be overwhelmed by their mass, instead you can start with the easy things: <strong>&ldquo;<q>harvest the low hanging fruit</q>.&rdquo;</strong> Enable caching with the Expire date setting and reduce the number of HTTP requests. You can deal with the rest later.</p>

<p>Finally Nate Koechley announced a Yahoo! performance tool called <strong><a href="http://developer.yahoo.com/yslow/">YSlow</a></strong> as a plugin for the indespensible <a href="http://www.getfirebug.com">Firebug</a> extension. He also recommended the commercial <a href="http://alphaworks.ibm.com/tech/pagedetailer">IBM Page Detailer</a>, and <a href="http://livehttpheaders.mozdev.org">LiveHTTPHeaders</a> to visualize what&rsquo;s happening in your browser.</p>
]]></content:encoded>
			<wfw:commentRss>http://learningtheworld.eu/2007/performance-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
<enclosure url="http://www.htmldog.com/atmedia2007/highperformancewebpages.mp3" length="26276424" type="audio/mpeg" />
		</item>
	</channel>
</rss>
