<?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>Wil Tan &#187; http</title>
	<atom:link href="http://dready.org/blog/category/http/feed/" rel="self" type="application/rss+xml" />
	<link>http://dready.org/blog</link>
	<description>musings on internationalized identifiers: domain names, OpenID, TLDs</description>
	<lastBuildDate>Thu, 15 Dec 2011 03:42:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Optimizing Autocomplete by Utilizing Browser Cache</title>
		<link>http://dready.org/blog/2010/03/29/optimizing-autocomplete-utilizing-browser-cache/</link>
		<comments>http://dready.org/blog/2010/03/29/optimizing-autocomplete-utilizing-browser-cache/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 08:35:59 +0000</pubDate>
		<dc:creator>wil</dc:creator>
				<category><![CDATA[dns]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[icann]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[tuning]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://dready.org/blog/?p=261</guid>
		<description><![CDATA[Say you have a snazzy AJAXified autocomplete field that gives instantaneous feedback to the user as she types &#8212; perhaps a username field on a signup form or something akin to Google Suggest. Except, it&#8217;s not performing as well as you thought it should. That round trip to the server for each character is taking [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Say you have a snazzy AJAXified autocomplete field that gives instantaneous feedback to the user as she types &#8212; perhaps a username field on a signup form or something akin to Google Suggest. Except, it&#8217;s not performing as well as you thought it should. That round trip to the server for each character is taking too long.</p>
<p>The first thing you should do is to see if HTTP Keep-Alive is supported by your server.</p>
<p>Second, and this may seem obvious, but I&#8217;ve seen too many developers forget to leave a hint to the browser to cache the results. As a result, the page becomes sluggish due to a feature that&#8217;s meant to be responsive.</p>
<p>See what happens behind the scene when you sign up for a new <a href="https://twitter.com/signup">Twitter account</a>. Suppose you try to register the username &#8220;wil&#8221;, but it&#8217;s taken. For each character you type, the browser makes HTTP requests to check that the username in the input field to see if it&#8217;s available.</p>
<p>So that&#8217;s one for &#8220;w&#8221;, &#8220;wi&#8221;, &#8220;wil&#8221;. Then you find that all 3 are taken. Ok, perhaps time to add a numeric suffix? &#8220;wil1&#8243; &#8211; nope, delete the &#8220;1&#8243;, and we&#8217;re back to &#8220;wil&#8221; again. Guess what? Another HTTP request is sent to Twitter for the same string &#8220;wil&#8221;! </p>
<p>Had Twitter set an &#8220;Expires&#8221; header to usernames that are taken, the browser wouldn&#8217;t have had to make that round trip!</p>
<p>Below are the headers sent by Twitter for the https://twitter.com/users/username_available URI (courtesy of <a href="http://hurl.it/">Hurl</a>):</p>
<p><iframe src="http://hurl.it/views/f24fa9d033f6a17feb1321d1531eea42059d5abb" width="440" height="460" style="overflow: auto"></iframe></p>
<p>In the case of signup forms, usernames are rather involatile pieces of data, so it&#8217;s a prime optimization target. As your namespace becomes more scarce, you&#8217;ll tend to have people trying more strange combinations, increasing the number of requests to your servers.</p>
<p>In my case, I&#8217;ve applied it to our <a href="http://www.cloudregistry.net/">TLD management platform</a>. Domain names that are registered gets a 10 minute cache timeout value (which is heaps short but good enough to ensure a snappy UI operations). However, with domain names, it&#8217;s a lot more volatile but we&#8217;re not guaranteeing success at the point of registering a name so anywhere between 1-5 minutes is usually sufficient.</p>
<p>A simple view snippet in Django does the trick and goes a long way to making your users happy.</p>
<p><script src="http://gist.github.com/347596.js"></script></p>
<p>/ Blogging from a HSDPA connection</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://dready.org/blog/2010/03/29/optimizing-autocomplete-utilizing-browser-cache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multipart Web Requests</title>
		<link>http://dready.org/blog/2007/10/02/multipart-web-requests/</link>
		<comments>http://dready.org/blog/2007/10/02/multipart-web-requests/#comments</comments>
		<pubDate>Tue, 02 Oct 2007 03:28:44 +0000</pubDate>
		<dc:creator>wil</dc:creator>
				<category><![CDATA[http]]></category>
		<category><![CDATA[webeng]]></category>
		<category><![CDATA[www]]></category>

		<guid isPermaLink="false">http://dready.org/blog/2007/10/02/multipart-web-requests/</guid>
		<description><![CDATA[Andy Skelton posted a proposal for a mechanism by which a web server could send related objects to a resource in response to a single request. It&#8217;s quite an interesting idea, although I&#8217;m not sure how much we could gain given that most clients today do HTTP pipelining.
It could reduce loads on the server, but [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p><a href="http://andy.wordpress.com/">Andy Skelton</a> posted a proposal for a <a href="http://andy.wordpress.com/2007/10/01/proposal-multipart-web-requests/">mechanism by which a web server could send related objects to a resource</a> in response to a single request. It&#8217;s quite an interesting idea, although I&#8217;m not sure how much we could gain given that most clients today do HTTP pipelining.</p>
<p>It <em>could</em> reduce loads on the server, but I&#8217;m not sure either. Most static content is served very efficiently on the server using the <a href="http://www.freebsd.org/cgi/man.cgi?query=sendfile&#038;sektion=2">sendfile (2)</a> system call. By mixing static content with dynamic (the HTML which has to know what its embedded objects are), it may be difficult to implement efficiently.</p>
<p>That said, it could have some merits, and a more in-depth analysis would be needed and I&#8217;d be interested to see how it pans out.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://dready.org/blog/2007/10/02/multipart-web-requests/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

