<?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>Nico.Berlee.nl &#187; RFC</title>
	<atom:link href="http://nico.berlee.nl/tag/rfc/feed/" rel="self" type="application/rss+xml" />
	<link>http://nico.berlee.nl</link>
	<description>a digital portfolio</description>
	<lastBuildDate>Sat, 21 Jan 2012 21:31:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Solved latency problems with Ajax</title>
		<link>http://nico.berlee.nl/solved-latency-problems-with-ajax/</link>
		<comments>http://nico.berlee.nl/solved-latency-problems-with-ajax/#comments</comments>
		<pubDate>Sat, 09 Sep 2006 15:06:47 +0000</pubDate>
		<dc:creator>Nico</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[cached]]></category>
		<category><![CDATA[Internet-Explorer]]></category>
		<category><![CDATA[latency]]></category>
		<category><![CDATA[RFC]]></category>

		<guid isPermaLink="false">http://nico.berlee.nl/solved-latency-problems-withajax/</guid>
		<description><![CDATA[Cache is your friend, not the enemy Internet Explorer handlesÂ AJAX responses different than other browsers. It will cache the response. The tendencyÂ on most articles I&#8217;ve read is: Caching is bad and you need disable caching!. No!!! Although Microsoft didn&#8217;t program Internet Explorer to respond according to RFC IE should do,Â that&#8217;s not an excuse to totally [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Cache is your friend, not the enemy</strong></p>
<p>Internet Explorer handlesÂ AJAX responses different than other browsers. It will cache the response. The tendencyÂ on most articles I&#8217;ve read is: Caching is bad and you need disable caching!. No!!! Although Microsoft didn&#8217;t program Internet Explorer to respond according to RFC IE should do,Â that&#8217;s not an excuse to totally disable Cache. When visitors click on a link they expect something happens. Although AJAX makes the response time shrink, you don&#8217;t have any guarantee about the noveltyÂ of the content.<span id="more-27"></span></p>
<p><strong>Sending the right headers</strong></p>
<p>No, I am not talking about soccer. WordPress sends headers to prevent caching. I changed that because caching is not that bad. It&#8217;s all about sending the right headers and extending the intelligence in WordPress. The WordPress database keeps track of all date and times when the content changed. This is great, because now you can incorporate that date and time into the header. The second time the user asks for the content, the client send a If-modified-since in the request header with the date and time of the first response of the same content. If the content isn&#8217;t changed since, the response will be a HTTP 304 Not Modified (nothing more), the client will than get it out of the memory or the temporary Internet files.</p>
<p>Typically this saves a lot of bandwidth and latency.</p>
<p><strong>Prefetching</strong></p>
<p>The JavaScript on the client side tries to guess if you go to click on a link or not, just by measuring the time your mouse cursor is on the link, if it&#8217;s more than 0.2 seconds, itÂ evaluates that chances are that you are eventually clicking on the linkÂ are big. So JavaScript starts fetching the page into memory.</p>
<p>In combination with the paragraph above, this gives a great performance boost. If the user doesn&#8217;t click on the link for now, it doesn&#8217;t matter because the next time the user might click on it, and on that point the JavaScript only have to collect a HTTP 304 Not Modified header (which is lesser than 300 bytes).</p>
]]></content:encoded>
			<wfw:commentRss>http://nico.berlee.nl/solved-latency-problems-with-ajax/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

