<?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>Joseph Scott &#187; http</title>
	<atom:link href="http://josephscott.org/archives/tag/http/feed/" rel="self" type="application/rss+xml" />
	<link>http://josephscott.org</link>
	<description></description>
	<lastBuildDate>Thu, 29 Jul 2010 16:56:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1-alpha</generator>
	<atom:link rel='hub' href='http://josephscott.org/?pushpress=hub'/>
<cloud domain='josephscott.org' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>The Loosely Coupled Web</title>
		<link>http://josephscott.org/archives/2010/06/the-loosely-coupled-web/</link>
		<comments>http://josephscott.org/archives/2010/06/the-loosely-coupled-web/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 04:54:36 +0000</pubDate>
		<dc:creator>Joseph Scott</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[loosely-coupled]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://josephscott.org/?p=2428</guid>
		<description><![CDATA[There are so many terms floating around for the &#8220;the web&#8221;. One that has been overly abused is &#8220;web 2.0&#8243;. Someone mentioned &#8220;web 2.0&#8243; during a conversation the other day and it reminded me that I had never written about my favorite alternative &#8220;web&#8221; term: &#8220;the loosely coupled web&#8221;. I&#8217;ve been tempted by &#8220;the open [...]


Related posts:<ol><li><a href='http://josephscott.org/archives/2010/05/facebook-future/' rel='bookmark' title='Permanent Link: Facebook Future'>Facebook Future</a></li>
<li><a href='http://josephscott.org/archives/2008/12/creative-commons-conundrum/' rel='bookmark' title='Permanent Link: Creative Commons Conundrum'>Creative Commons Conundrum</a></li>
<li><a href='http://josephscott.org/archives/2008/10/josephscott-org/' rel='bookmark' title='Permanent Link: JosephScott.org'>JosephScott.org</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>There are so many terms floating around for the &#8220;the web&#8221;.  One that has been overly abused is &#8220;web 2.0&#8243;.  Someone mentioned &#8220;web 2.0&#8243; during a conversation the other day and it reminded me that I had never written about my favorite alternative &#8220;web&#8221; term: &#8220;the loosely coupled web&#8221;.  I&#8217;ve been tempted by &#8220;the open web&#8221;, but the term open has been smashed beyond recognition.</p>
<p>What do I mean by loosely coupled?  It means I can start a new site that provides specific services, and people can easily build off it without my intervention.   A great general example of this is the core of the web itself: HTTP.  When you put up a new site browsers just work with it, right out of the box.</p>
<p>Another example is WordPress and the XML-RPC APIs.  If you want to write a new blog client that works with WordPress you don&#8217;t need to create an account any where or sign up for anything extra.  You make use of the common APIs that WordPress provides and go to town.  RSS and Atom feeds fall into the same category.</p>
<p>I think it is also possible to be loosely coupled in a more specific scope.  For example some of Facebook&#8217;s <a href="http://developers.facebook.com/docs/api">Graph API</a> I&#8217;d consider loosely coupled.  You need to know a little bit about it to understand how to make requests and how to read the responses, but that&#8217;s it.  And I like the low barrier that loosely coupled implies.  As you get deeper there are additional requirements, but at least to get started there is very little friction.</p>
<p>I&#8217;m no where near the first to use this term ( a quick <a href="http://www.google.com/search?q=the+loosely+coupled+web">Google search</a> turns up plenty of hits ), but I don&#8217;t think it has received as much respect as it deserves.</p>


<p>Related posts:<ol><li><a href='http://josephscott.org/archives/2010/05/facebook-future/' rel='bookmark' title='Permanent Link: Facebook Future'>Facebook Future</a></li>
<li><a href='http://josephscott.org/archives/2008/12/creative-commons-conundrum/' rel='bookmark' title='Permanent Link: Creative Commons Conundrum'>Creative Commons Conundrum</a></li>
<li><a href='http://josephscott.org/archives/2008/10/josephscott-org/' rel='bookmark' title='Permanent Link: JosephScott.org'>JosephScott.org</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://josephscott.org/archives/2010/06/the-loosely-coupled-web/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XMLHttpRequest (XHR) Uses Multiple Packets for HTTP POST?</title>
		<link>http://josephscott.org/archives/2009/08/xmlhttprequest-xhr-uses-multiple-packets-for-http-post/</link>
		<comments>http://josephscott.org/archives/2009/08/xmlhttprequest-xhr-uses-multiple-packets-for-http-post/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 15:53:54 +0000</pubDate>
		<dc:creator>Joseph Scott</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[xhr]]></category>

		<guid isPermaLink="false">http://josephscott.org/?p=1411</guid>
		<description><![CDATA[A recent Think Vitamin article, The Definitive Guide to GET vs POST, mentioned something that I hadn&#8217;t seen before about XMLHttpRequest (XHR). Their Rule #4 states: When using XMLHttpRequest, browsers implement POST as a two-step process (sending the headers first and then the data). This means that GET requests are more responsive – something you [...]


Related posts:<ol><li><a href='http://josephscott.org/archives/2010/07/xhr-ajax-performance-get-or-post/' rel='bookmark' title='Permanent Link: XHR / AJAX Performance &#8211; GET or POST?'>XHR / AJAX Performance &#8211; GET or POST?</a></li>
<li><a href='http://josephscott.org/archives/2009/11/browser-stats-and-five-years-of-firefox/' rel='bookmark' title='Permanent Link: Browser Stats and Five Years of Firefox'>Browser Stats and Five Years of Firefox</a></li>
<li><a href='http://josephscott.org/archives/2010/02/recommended-reading-steve-souders-high-performance-web-sites/' rel='bookmark' title='Permanent Link: Recommended Reading: Steve Souders, High Performance Web Sites'>Recommended Reading: Steve Souders, High Performance Web Sites</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>A recent Think Vitamin article, <a href="http://carsonified.com/blog/dev/the-definitive-guide-to-get-vs-post/">The Definitive Guide to GET vs POST</a>, mentioned something that I hadn&#8217;t seen before about XMLHttpRequest (XHR).  Their Rule #4 states:</p>
<blockquote><p>
When using XMLHttpRequest, browsers implement POST as a two-step process (sending the headers first and then the data). This means that GET requests are more responsive – something you need in AJAX environments.
</p></blockquote>
<p>The claim is that even the smallest XHR will be sent using two packets if the request is done over HTTP POST instead of HTTP GET.  I don&#8217;t remember ever having heard this claim before.</p>
<p>Let me first say that performance issues for POST vs. GET probably shouldn&#8217;t be your top factor for deciding which one to use.  Make sure that you understand the implications of each and pick the right method for your request.  For most people I suspect the biggest factor will involve caching, not performance.  I was going to leave a comment on the article about this, but <a href="http://carsonified.com/blog/dev/the-definitive-guide-to-get-vs-post/#comment-13698">Simon beat me to it</a>.</p>
<p>I wasn&#8217;t the only one who wanted to find out more about XHR POST using multiple packets.  Fortunately someone else already <a href="http://carsonified.com/blog/dev/the-definitive-guide-to-get-vs-post/#comment-13556">asked that question</a> and the author <a href="http://carsonified.com/blog/dev/the-definitive-guide-to-get-vs-post/#comment-13569">replied</a>:</p>
<blockquote><p>
2. My claim is based on research done by Iain Lamb, cofounder of the Oddpost webmail startup that was acquired by Yahoo! and eventually became the basis for the all-new Yahoo! Mail.</p>
<p>His research showed “rather baffling finding: POST requests, made via the XMLHTTP object, send header and body data in separate tcp/ip packets [and therefore,] xmlhttp GET performs better when sending small amounts of data than an xmlhttp POST.”</p>
<p>That is why Yahoo includes the use of GET instead of POST as one of their high performance speed optimisation rules.
</p></blockquote>
<p>Simon Willison did some looking around and <a href="http://simonwillison.net/2009/Aug/18/performance/#comments">found more links for this</a>.  It was mentioned <a href="http://developer.yahoo.com/performance/rules.html">here</a> and <a href="http://yuiblog.com/blog/2007/03/01/performance-research-part-3/#comment-59531">here</a>, so it looks like <a href="http://lamb.cc/">Iain Lamb</a> did do this research, even though I couldn&#8217;t find a first person account of it.  This was enough information to make me curious, but not enough to answer all of my questions.  It was time to run some tests of my own.</p>
<p>So I updated my install of <a href="http://www.wireshark.org/">Wireshark</a> on Windows XP, turned off all of the packet reassembly options for HTTP decoding and started testing browsers.  My very simple XHR POST test page looked like this:</p>
<pre class="brush: xml;">
&lt;button type=&quot;button&quot; onclick=&quot;$.post('hello.txt', {name: 'Joseph'})&quot;&gt;XHR POST&lt;/button&gt;
&lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js&quot;&gt;&lt;/script&gt;
</pre>
<p>When the button is clicked an XHR POST request is made to hello.txt with the name=Joseph for a tiny amount of data.  The domain I tested on sent along some cookies as well, but still left enough room for the tiny POST payload to fit in a single TCP packet.</p>
<p>Here are the results of the tests that I ran:</p>
<ul>
<li>IE 6 &#8211; 2 packets</li>
<li>IE 7 &#8211; 2 packets</li>
<li>IE 8 &#8211; 2 packets</li>
<li><b>Firefox 3.0.13 &#8211; 1 packet</b></li>
<li><b>Firefox 3.5.2 &#8211; 1 packet</b></li>
<li>Opera 9.27 &#8211; 2 packets</li>
<li>Safari 4.0.3 &#8211; 2 packets</li>
<li>Chrome 2.0.172.43 &#8211; 2 packets</li>
</ul>
<p>The short version of this is pretty easy to see, all of the browsers except for Firefox will use at least 2 packets for an XHR done over HTTP POST.  When I saw that Safari sent 2 packets I figured that Chrome would as well, but I tested it anyway just to make sure.</p>
<p>I looked at the data size of each packet in IE 6; the first packet had 575 bytes of data and the second packet had 11 bytes of data.  This lined up with the POST request which indicated that the content length was 11 bytes.  The second packet consisted only of the POST data.  Because Firefox sent less data in the user-agent string I increased the POST data so that it would exceed the combined total of the two IE packets to make sure I wasn&#8217;t running into any odd packet fragmentation.  The second packet in Opera, Safari and Chrome was also only the 11 bytes of POST data.</p>
<p>If this were <a href="http://dsc.discovery.com/fansites/mythbusters/mythbusters.html">Myth Busters</a> I&#8217;d call this myth confirmed.  While it is true that not ALL browsers will always use two packets, it appears that the two packet process is the rule, not the exception.  And with <a href="http://gs.statcounter.com/#browser-ww-monthly-200807-200908">IE still the most widely used browser</a> it&#8217;s very likely that a large portion of your users fall into the two packet category.  If on the other hand 95% of your users happen to be using Firefox, then sure, you can skip thinking about this.</p>


<p>Related posts:<ol><li><a href='http://josephscott.org/archives/2010/07/xhr-ajax-performance-get-or-post/' rel='bookmark' title='Permanent Link: XHR / AJAX Performance &#8211; GET or POST?'>XHR / AJAX Performance &#8211; GET or POST?</a></li>
<li><a href='http://josephscott.org/archives/2009/11/browser-stats-and-five-years-of-firefox/' rel='bookmark' title='Permanent Link: Browser Stats and Five Years of Firefox'>Browser Stats and Five Years of Firefox</a></li>
<li><a href='http://josephscott.org/archives/2010/02/recommended-reading-steve-souders-high-performance-web-sites/' rel='bookmark' title='Permanent Link: Recommended Reading: Steve Souders, High Performance Web Sites'>Recommended Reading: Steve Souders, High Performance Web Sites</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://josephscott.org/archives/2009/08/xmlhttprequest-xhr-uses-multiple-packets-for-http-post/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
	</channel>
</rss>