<?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>getiblog &#187; delivery</title>
	<atom:link href="http://blog.getify.com/tag/delivery/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.getify.com</link>
	<description>javascript, performance, and ui musings</description>
	<lastBuildDate>Thu, 15 Dec 2011 17:37:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Resource Packaging? Silver Bullet?</title>
		<link>http://blog.getify.com/resource-packaging-silver-bullet/</link>
		<comments>http://blog.getify.com/resource-packaging-silver-bullet/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 18:03:43 +0000</pubDate>
		<dc:creator>getify</dc:creator>
				<category><![CDATA[UI Architecture]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[delivery]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[packaging]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[ui]]></category>

		<guid isPermaLink="false">http://blog.getify.com/?p=23</guid>
		<description><![CDATA[There&#8217;s been some buzz lately about a proposal for a technique of UI delivery optimization called Resource Packaging. Steve Souders weighed in on the proposal with resounding support. Essentially, the idea is that web developers could proactively create .ZIP files of various page resources (images, CSS, JS, etc), and include in their page a special [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s been <a href="http://ajaxian.com/archives/resource-packages-making-a-faster-web-via-packaging">some buzz</a> lately about a proposal for a technique of UI delivery optimization called <a href="http://limi.net/articles/resource-packages/">Resource Packaging</a>. Steve Souders <a href="http://www.stevesouders.com/blog/2009/11/18/fewer-requests-through-resource-packages/">weighed in on the proposal</a> with resounding support.</p>
<p>Essentially, the idea is that web developers could proactively create .ZIP files of various page resources (images, CSS, JS, etc), and include in their page a special &lt;link> tag pointing to that &#8220;package&#8221;. Smart, elite browsers (like FF 3.7!?) would grab this resource package, unzip and cache the resources, and ostensibly then know how to skip trying to download them from their normal references in the rest of the HTML page. The idea is of course the all-important, oft-mentioned &#8220;reduce HTTP requests down to the most absolute minimum possible&#8221; rule that we all have blazened into our psyche.</p>
<h2>Wait, you mean you don&#8217;t agree with HTTP request reduction?</h2>
<p>On it&#8217;s surface, I don&#8217;t disagree with &#8220;minimize HTTP requests&#8221;. Certainly that&#8217;s a good and very important goal. If you needlessly create additional requests because you are ignorant or lazy and fail to employ even simple strategies (like image spriting, for instance), you are asking to crash your server(s) when your traffic increases.</p>
<p>But I believe there&#8217;s a paranoia spreading in the UI development and production community that the reduction of HTTP requests is penultimate and more important than any other strategy, to the exclusion of alternative perfectly reasonable practices for UI delivery optimization. </p>
<p>For instance, you hear people all the time say, &#8220;concat all your JavaScript into one file&#8221; for production. But is this really the right approach? I won&#8217;t go into the details here of why I disagree with this as a blanket approach, as I cover that <a href="http://blog.getify.com/2009/11/labjs-why-not-just-concat/">fully in this post</a>, but suffice it to say, I think we must balance HTTP request reduction paranoia against some other sanity checks.</p>
<h2>So what&#8217;s wrong with resource packaging?</h2>
<p>I have a number of issues with this idea. Let me lay them out for you:</p>
<p>In reality, what I&#8217;m <em>most</em> worried about is that this&#8217;ll be seen as the silver bullet and just deployed in widespread and often under-optimized ways, and will propogate what I think is a dangerous anti-pattern: People are so paranoid about HTTP request overhead (because let&#8217;s face it, we all think our site will get slashdot&#8217;d or hit digg.com homepage so we better be ultra-micro-optimized for millions of hits per minute!) that they&#8217;ll just default to putting everything in one resource package.</p>
<p>When that seems to work well in their dev environment, they&#8217;ll just roll that out and blindly think it&#8217;s ok. When you give people a dangerous amount of rope, it&#8217;s hard to not expect at least a good number of people will hang themselves with it.</p>
<p>Remember the good ol&#8217; days, when people created full-page flash sites, and when you visited the site, you sat and mindlessly watched a preloader animation while megabytes of content were all loaded at once? Oh, that was fun. I miss those days.</p>
<p>No, wait! I don&#8217;t miss that at all. Actually, I love that now we as a collective community realize that a critical part of user-experience is <strong>initial page loading</strong> behavior. I love that <a href="http://www.directtrafficmedia.co.uk/News/SEO_Must_Consider_Page_Speed_for_Google_Rankings_in_2010_51117540380.html">Google is going to start ranking pages based on how well they load</a>. This is a healthy, even if slightly uncomfortable, nudging in the right direction.</p>
<p>But worse yet, if abused (either intentionally or not), I think this pattern will have worse overall performance than if people had just left their sites as they currently are.</p>
<p>Compare this type of approach to say someone taking more targetted/focused approaches to UI optimization. For instance, you could use <a href="http://labjs.com">LABjs</a> for loading scripts in parallel with each other and the rest of the page resources&#8230; or use <a href="http://spriteme.com">spriting</a>&#8230; or how about css concatenation? </p>
<p>Each of those techniques is more narrow in focus and has much less potential for going wrong when employed, in terms of both pattern <strong>and</strong> practice. But one big single &#8220;solution to rule them all&#8221; has both enough upside <strong>and</strong> downside that I fear it could go seriously off track if used wrongly.</p>
<h2>Aren&#8217;t YOU just being paranoid or pessimistic about web developer ignorance?</h2>
<p>In addition to the potential improper usage patterns, I also think there are tangible issues that the proposal and Souders&#8217; post don&#8217;t address, at least not completely:</p>
<ol>
<li>Relying on a technique which only works (in any forseeable future) in one (or a couple at best) browser(s) will promote yet another anti-pattern&#8230; optimizing for a subset of browsers and ignoring performance in other browsers.
<p>I know there&#8217;s lots of people out there who find it vogue to discard performance in IE and say &#8220;well, the deserve what they get for using a crappy browser.&#8221; But I don&#8217;t think that&#8217;s productive or realistic. Wouldn&#8217;t our time be better spent finding (and educating about!) new ways (like LABjs, spriting, css concatenation) to optimize the UI performance that <strong>will</strong> improve things in practically <strong>all</strong> browsers? </p>
<p>Doesn&#8217;t that serve the web community better than just myopically focusing on one (admittedly growing) segment that uses a bleeding-edge browser version and implements a new feature idea before it&#8217;s even really a standard?</li>
<li>What about resources that are CDN&#8217;d? Sure, you host some of your resources locally, but hopefully you are moving toward putting more and more of your stuff remotely, out on the edge, via CDN&#8217;s. There&#8217;s no doubt this is a powerful technique, and is only going to increase in importance.
<p>And forget CDN&#8217;s (at least technically) for the moment. I&#8217;ve never once rolled out a site where I didn&#8217;t link to at least one or a couple of remote resources. For instance, I use Google Analytics on all my pages, I often use an AddThis social badge script (and images), Google Groups forms and images, etc, etc, etc. What should I do with all these non-local page resources?</p>
<p>So do you really even have <em>that many</em> resources locally that it makes sense to package? And what if people employ another anti-pattern and start hosting and packaging locally what could have otherwise been better hosted remotely (CDN or not) and shared globally? Are we going to keep relying on browsers to get smarter and smarter, enough that now they can resolve all these local vs. remote/CDN versions of files in the Package Manifest for us and choose the correct ones?</p>
<p>I get scared when I start thinking about the browser trying to be smarter than I am about how it optimizes UI delivery performance.</li>
<li>What about parallel downloading? If you load a single file and it&#8217;s 1 MB in size, the browser will likely download that thing byte-by-byte, serially. At least until we get to using BitTorrent for our page resources!
<p>But wait, what if you downloaded 3 files instead? It&#8217;d download in roughly 1/3 the time, right? That&#8217;s cool. Now, that math doesn&#8217;t stretch on forever&#8230; obviously there&#8217;s a point where the overhead of HTTP Requests starts to degrade the power of parallel downloading. But there&#8217;s got to be some balance, some sweet spot between 1 file and 100 files? </p>
<p>And I bet that number varies from site to site. For some, maybe it&#8217;s 2. For others, maybe it&#8217;s 4. So this is one more variable that web deployment engineers have to experiment with and figure out the black magic of what&#8217;s best for their site. Again, I bet most will end up punting on multiple resource packages and will just use one file. I doubt this will be a good thing for most sites.</p>
<p>Remember this (pessimism or realism): if figuring out what&#8217;s best is not intuitive, <em>most</em> won&#8217;t do it.</li>
</ol>
<p>Here&#8217;s the bottom line: Resource Packaging sounds good in theory. But I suspect the practice of it will be quite flawed, and we&#8217;ll have yet another dimension of suckiness out in the UI delivery world that we&#8217;ll all have to wade through and educate on how to get it right.</p>
<h2>Ding!</h2>
<p>Wait, I just thought of something! While we&#8217;re at the business of packaging things up to reduce requests&#8230; how about we <strong>JUST</strong> deliver a zip file to the browser, which includes everything, even the HTML for the page? </p>
<p>In fact, does it even need to be a ZIP file? What about if we could figure out a special file format (which I&#8217;m sure wouldn&#8217;t ever get bogged down in proprietary rights/trademarks or disagreements over specification), and in that way we can make that single file really optimized (&#8220;compiled&#8221;), and the browser could just get really smart about &#8220;executing&#8221; our page for us? We&#8217;d achieve the all-imporant single-page, single HTTP-request &#8220;golden ratio&#8221;.</p>
<p>And for all those old, busted, non-conforming (non-bleeding-edge) browsers, we&#8217;ll just ask users to install a plugin to assist the browser in processing the page. People like plugins, right?</p>
<p>Oh, wait. Nope. We&#8217;ve tried that before. Many times. It was called Java. Then it was called Flash. Now it&#8217;s called Silverlight or JavaFX. And thankfully we&#8217;ve evolved to a higher level of consciousness. Or so I hope.</p>
<div><a class="addthis_button" href="//addthis.com/bookmark.php?v=250" addthis:url='http://blog.getify.com/resource-packaging-silver-bullet/' addthis:title='Resource Packaging? Silver Bullet? '><img src="//cache.addthis.com/cachefly/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.getify.com/resource-packaging-silver-bullet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Content Delivery Network via getiblog.2static.it

Served from: blog.getify.com @ 2012-05-18 09:30:05 -->
