<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.3" -->
<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/"
	>

<channel>
	<title>HttpWatch Blog</title>
	<link>http://blog.httpwatch.com</link>
	<description>News, articles and all things HttpWatch</description>
	<pubDate>Wed, 30 Apr 2008 10:47:13 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
	<language>en</language>
			<item>
		<title>Fixing the &#8216;Do you want to display nonsecure items&#8217; message</title>
		<link>http://blog.httpwatch.com/2008/04/30/fixing-the-do-you-want-to-display-nonsecure-items-message/</link>
		<comments>http://blog.httpwatch.com/2008/04/30/fixing-the-do-you-want-to-display-nonsecure-items-message/#comments</comments>
		<pubDate>Wed, 30 Apr 2008 10:47:13 +0000</pubDate>
		<dc:creator>Httpwatch Blog</dc:creator>
		
		<category><![CDATA[Caching]]></category>

		<category><![CDATA[HTTP]]></category>

		<category><![CDATA[HTTPS]]></category>

		<category><![CDATA[HttpWatch]]></category>

		<category><![CDATA[Internet Explorer]]></category>

		<category><![CDATA[IE]]></category>

		<guid isPermaLink="false">http://blog.httpwatch.com/2008/04/30/fixing-the-do-you-want-to-display-nonsecure-items-message/</guid>
		<description><![CDATA[Have you ever been to a web site and seen this?

This warning is triggered in IE if it is displaying a secure HTTPS page that has caused a non-secure (i.e. HTTP based) resource to be downloaded. The message box doesn&#8217;t allow the user to control whether the non-secure content should be downloaded, only whether it should be displayed. 
This [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever been to a web site and seen this?</p>
<p><img src="http://blog.httpwatch.com/wp-content/uploads/2008/04/nonsecure_items.png" alt="Non secure items warning in IE" /></p>
<p>This warning is triggered in IE if it is displaying a secure HTTPS page that has caused a non-secure (i.e. HTTP based) resource to be downloaded. The message box doesn&#8217;t allow the user to control whether the non-secure content should be downloaded, only whether it should be displayed. </p>
<p>This seems rather pointless as the damage may already have been done if the non-secure content was a picture of your passport, bank statement or credit card! However, this is the default setting in IE so it is best to avoid this warning being generated on your web site.</p>
<p>This setting can be changed in IE by:</p>
<ol>
<li>In IE go to Tools-&gt;Internet Options-&gt;Security</li>
<li>Select the &#8216;Security&#8217; tab</li>
<li>Click the &#8216;Custom Level&#8217; button</li>
<li>In the &#8217;Miscellaneous&#8217; section change &#8220;Display mixed content&#8221; to Enable</li>
</ol>
<p>Recently, we saw this warning in the shopping cart of an  <a href="http://ebuyer.com" title="EBuyer">computer store</a>,  so we fired up HttpWatch to see what was causing the problem. A quick search for a URL starting with &#8216;http:&#8217; should have located the request causing the problem:</p>
<p><img src="http://blog.httpwatch.com/wp-content/uploads/2008/04/http_not_found.png" alt="HttpWatch trace for nonsecure items message at Ebuyer" /></p>
<p>No HTTP requests were recorded for this page in HttpWatch. So what was causing the &#8216;Do you want to display nonsecure items&#8217; message?</p>
<p>It turns out that IE warns about HTTP based content even if it was read from the browser cache or the IE image cache. Requests from the browser cache are shown as (Cache) in HttpWatch, but as we <a href="http://blog.httpwatch.com/2008/02/27/image-caching-in-internet-explorer/" title="IE image cache">previously described</a> access to the IE image cache is not recorded.</p>
<p>The resource causing the warning on this page must have been read from the image cache. We confirmed this by refreshing the page in IE and performing another search:</p>
<p><img src="http://blog.httpwatch.com/wp-content/uploads/2008/04/http_found2.png" alt="Image causing nonsecure items warning" /></p>
<p>The refresh forced IE to download all the embedded resources on the page and it became clear that it was the Google Checkout image that was causing the problem. Changing this image&#8217;s URL to use HTTPS would prevent the warning from appearing.</p>
 <img src="http://blog.httpwatch.com/wp-content/plugins/feed-statistics.php?view=1&post_id=99" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.httpwatch.com/2008/04/30/fixing-the-do-you-want-to-display-nonsecure-items-message/feed/</wfw:commentRss>
		</item>
		<item>
		<title>What are people saying about HttpWatch?</title>
		<link>http://blog.httpwatch.com/2008/04/23/what-are-people-saying-about-httpwatch/</link>
		<comments>http://blog.httpwatch.com/2008/04/23/what-are-people-saying-about-httpwatch/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 12:00:00 +0000</pubDate>
		<dc:creator>Httpwatch Blog</dc:creator>
		
		<category><![CDATA[HttpWatch]]></category>

		<guid isPermaLink="false">http://blog.httpwatch.com/2008/04/23/what-are-people-saying-about-httpwatch/</guid>
		<description><![CDATA[Here&#8217;s a summary of some recent blog posts that have mentioned HttpWatch:
&#8220;My team has been using HttpWatch for a few months now to analyze the client side performance of SkyDrive.  Previously, I had relied on some internal tools we use that are based on NetMon, as well as Fiddler and Firebug with the YSlow plugin.  [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a summary of some recent blog posts that have mentioned HttpWatch:</p>
<blockquote><p><em>&#8220;My team has been using </em><a href="http://www.httpwatch.com/"><em>HttpWatch</em></a><em> for a few months now to analyze the client side performance of </em><a href="http://skydrive.live.com/"><em>SkyDrive</em></a><em>.  Previously, I had relied on some internal tools we use that are based on NetMon, as well as Fiddler and Firebug with the YSlow plugin.  While these tools were pretty good, here&#8217;s why I think HttpWatch beats them all&#8221;</em></p>
<p>from <font color="#000000"><a href="http://blogs.msdn.com/joshzana/archive/2008/01/02/httpwatch-my-favorite-web-performance-tool.aspx">HttpWatch - My favorite web performance tool</a>, </font></p>
<p><em>&#8220;Inspecting the payload your server is issuing out can be quite tricky, luckily for the likes of you and I the boffin&#8217;s at Microsoft created </em><a target="_blank" href="http://www.fiddlertool.com/fiddler/"><em>Fiddler</em></a><em> and </em><a target="_blank" href="http://www.httpwatch.com/company/"><em>Simtec</em></a><em> created </em><a target="_blank" href="http://www.httpwatch.com/"><em>HttpWatch</em></a><em> (which I use every single day - probably the best developer tool I&#8217;ve got in my arsenal, it&#8217;s also coincidentally the tool you&#8217;ll see screen shots from throughout this article)&#8221;</em></p>
<p>from <a href="http://weblogs.asp.net/plip/archive/2008/02/09/pimp-my-asp-net-web-application-part-one.aspx">Pimp my ASP.NET web application - Part One</a></p>
<p><em>&#8220;Wow, I thought I was good at learning about new tools, but I never heard about </em><a href="http://www.httpwatch.com/"><em>HttpWatch</em></a> <em>&#8230; </em><em>It works much in the same way as Firebug, as a add-in to Internet Explorer. It looks really really cool, and some of the features are even better than Firebug. I like how it even gives you insight into the TCP level of your browsing sessions, such as how much time a DNS lookup takes&#8221;</em></p>
<p>from <a href="http://pessoal.org/blog/2008/03/01/httpwatch-commercial-alternative-to-firebug-for-internet-explorer/">Httpwatch: Commercial alternative to Firebug for Internet Explorer</a></p>
<p><em>&#8220;While modifying a website</em><em> which uses AJAX, we are converting from a rather non-standard implementation of AJAX calls to one that is a lot more standard.  But, we&#8217;re still concerned about the number of the objects being downloaded, the size of each object, the time each object takes to download, the number of round-trips, etc. We wanted a way to easily visualize what&#8217;s happening. HttpWatch provides a way&#8221;</em></p>
<p>from <a href="http://www.sqablogs.com/jstrazzere/1556/">A New Tool in My Tester&#8217;s Tool Box - HttpWatch</a></p>
<p><em>&#8220;</em><a href="http://httpwatch.com/"><font color="#2277dd"><em>HttpWatch</em></font></a><em> is a great add-on tool to Internet Explorer that captures your IE HTTP traffic. The best part for me is that it can be driven programaticly from my Watir Tests.</em><em>&#8220;</em></p>
<p>from <a rel="bookmark" href="http://www.marekj.com/2008/04/15/using-httpwatch-with-watir/" title="Permanent Link to ">Using HttpWatch with Watir</a></p></blockquote>
 <img src="http://blog.httpwatch.com/wp-content/plugins/feed-statistics.php?view=1&post_id=98" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.httpwatch.com/2008/04/23/what-are-people-saying-about-httpwatch/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The Performance Benefits of Ajax</title>
		<link>http://blog.httpwatch.com/2008/04/18/the-performance-benefits-of-ajax/</link>
		<comments>http://blog.httpwatch.com/2008/04/18/the-performance-benefits-of-ajax/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 10:56:27 +0000</pubDate>
		<dc:creator>Httpwatch Blog</dc:creator>
		
		<category><![CDATA[HTTP]]></category>

		<category><![CDATA[HttpWatch]]></category>

		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[Optimization]]></category>

		<category><![CDATA[Ajax]]></category>

		<category><![CDATA[XmlHttpRequest]]></category>

		<guid isPermaLink="false">http://blog.httpwatch.com/2008/04/18/the-performance-benefits-of-ajax/</guid>
		<description><![CDATA[Web 2.0 is a term often used to describe next generation web sites that have moved beyond the simple page request-&#62;process-&#62;response cycle and are utilizing services on the web server to return data that can be rendered without making page transitions. The result is often a more responsive user interface that closely mimics a desktop application.
The [...]]]></description>
			<content:encoded><![CDATA[<p>Web 2.0 is a term often used to describe next generation web sites that have moved beyond the simple page request-&gt;process-&gt;response cycle and are utilizing services on the web server to return data that can be rendered without making page transitions. The result is often a more responsive user interface that closely mimics a desktop application.</p>
<p>The technology to make HTTP calls from JavaScript embedded in an HTML page was first introduced for general use by Microsoft in IE5 in order to support <a href="http://en.wikipedia.org/wiki/Outlook_Web_Access" title="http://en.wikipedia.org/wiki/Outlook_Web_Access">Outlook Web Access</a> way back in 1999. However, the <a href="http://en.wikipedia.org/wiki/Xmlhttprequest" title="http://en.wikipedia.org/wiki/Xmlhttprequest">XmlHttpRequest</a> object was not widely used until it was adopted by Mozilla in 2002. In 2005 the programming model was <a href="http://www.adaptivepath.com/ideas/essays/archives/000385.php" title="http://www.adaptivepath.com/ideas/essays/archives/000385.php">given the name</a> <em>Ajax</em> which has now been widely recognised and stands for <em>Asynchronous JavaScript + XML</em>.<s></s></p>
<p>From a performance perspective Ajax has two main benefits:</p>
<ol>
<li>It can <a href="http://blog.httpwatch.com/2007/11/05/why-is-google-so-fast/">reduce the number of round trips</a> by minimizing the number of page transitions in a web application</li>
<li>It can <a href="http://blog.httpwatch.com/2008/01/18/the-performance-impact-of-uploaded-data/" title="Performance impact of uploaded data">reduce the size of uploaded</a> and downloaded data because it allows the web programmer to control exactly what is transferred. For example, if a user performs a search the data can be returned in a compact data format (e.g. <a href="http://www.json.org/" title="JSON data format">JSON</a> ) rather than HTML.</li>
</ol>
<p>In order to illustrate how Ajax can increase the speed and usability of a site let&#8217;s first look at a traditional web site and then compare it to an Ajax example.</p>
<p>This is what happens on Expedia.com when we try to book a flight but we specify a partial or mispelled city code. In this case we typed in &#8220;LOND&#8221; instead of &#8220;LON&#8221; or &#8220;London&#8221;. We expectantly press the submit button hoping for a list of possible flights, but instead we&#8217;re directed to an error page:</p>
<p><img src="http://blog.httpwatch.com/wp-content/uploads/2008/04/expedia_city1.png" alt="Expedia Error Page" /></p>
<p>Using HttpWatch we can see that Expedia took 4.4 seconds, 30 round trips and 156K of data (of which 41K was uploaded)  to display the error page:</p>
<p><img src="http://blog.httpwatch.com/wp-content/uploads/2008/04/expedia_summary1.png" alt="Expedia Error Page Summary" /></p>
<p>Even if there are no further mistakes we will still have to make further page transitions before we get the results we&#8217;re expecting.</p>
<p>Let&#8217;s look at a similar example on BA.COM where Ajax has been used:</p>
<p><img src="http://blog.httpwatch.com/wp-content/uploads/2008/04/ba_cities.png" alt="BA Cities List" /></p>
<p>Here we did exactly the same thing - typed &#8220;LOND&#8221; instead of London. Instead of having to press submit, fetch a new choices page (with all linked page components) and drag the user through an additional form, the page used background processing to query the server and display a list of possible choices.</p>
<p>The beauty of this approach is that is that it didn&#8217;t require any user interaction, is very fast and it didn&#8217;t leave the search page. Here&#8217;s the Ajax request in HttpWatch:</p>
<p><img src="http://blog.httpwatch.com/wp-content/uploads/2008/04/ba_ajax.png" alt="BA Ajax Request" /></p>
<p>BA.COM uses the <a href="http://getahead.org/dwr/">DWR</a> framework for Ajax to request the possible airports. The framework returns a JavaScript list used to render the content into the dropdown list control. The single HTTP call required is much smaller and faster than the Expedia model where the whole page must be<strong><em> </em></strong>fetched and rendered.</p>
<p>Due to the inconsistencies between the programmable object models on different browsers, most developers now choose a framework to ease JavaScript development and most provide Ajax helper functions that wrap XmlHttpRequest. Java&#8217;s <a href="http://en.wikipedia.org/wiki/DWR_%28Java%29" title="http://en.wikipedia.org/wiki/DWR_%28Java%29">DWR</a> has RPC style support. ASP.Net&#8217;s <a href="http://www.asp.net/ajax/" title="http://www.asp.net/ajax/">Ajax library</a>, <a href="http://dojotoolkit.org/" title="http://dojotoolkit.org/">Dojo</a>, Yahoo&#8217;s <a href="http://developer.yahoo.com/yui/" title="http://developer.yahoo.com/yui/">YUI</a> and Google&#8217;s <a href="http://code.google.com/webtoolkit/" title="http://code.google.com/webtoolkit/">GWT</a> support a whole suite of UI and control extensions as well as offering some kind of Ajax support. Similarly, <a href="http://www.prototypejs.org/learn" title="http://www.prototypejs.org/learn">Prototype</a> and <a href="http://jquery.com/" title="http://jquery.com/">jQuery</a> are two extremely lightweight and popular JavaScript libraries.</p>
<p>Let&#8217;s say you wanted to populate a list box with city codes based on the country a user selects. In Web 1.0 you would have to submit a form making a round-trip to the server with your choice of country so that the server could render the appropriate list of choices on the resulting HTML page.</p>
<p>With Ajax, this can all be done in the background. A lot of services use the XML data format, but there&#8217;s no restriction on the content type that XmlHttpRequest can send or receive. It could be HTML, JSON or any other format that the page&#8217;s JavaScript can parse.  Here&#8217;s an example of using the jQuery library to populate a list control from an Ajax request:</p>
<p><code>&lt;script type="text/javascript" src="<strong>jQuery.js</strong>&#8220;&gt;&lt;/script&gt;<br />
</code><code>...<br />
&lt;h2&gt;Products&lt;/h2&gt;<br />
&lt;div id="<strong>products</strong>&#8220;&gt;(fetching product list &#8230;)&lt;/div&gt;<br />
&lt;script&gt;<br />
&#8230;<br />
new <strong>Ajax</strong>.<strong>Updater</strong>(&#8217;products&#8217;, &#8216;/productListHTML.aspx&#8217;, { method: &#8216;get&#8217; });<br />
&#8230;<br />
&lt;/script&gt;<br />
</code></p>
<p>The products &lt;div&gt; is initially empty, but the Ajax class Updater method wraps <em>XmlHttpRequest</em> and fetches some HTML from the server and uses it to populate the &lt;div&gt;.</p>
<p>One of the drawbacks people found with using Ajax was that they ended up <a href="http://blog.httpwatch.com/2007/10/03/60-of-web-users-can%e2%80%99t-be-wrong-%e2%80%93-don%e2%80%99t-break-the-back-button/">breaking the back button</a>. Clicking the Back button in some Ajax applications did not go to the previous logical operation. For example, if you were viewing the results of a search you would expect Back to take you to the search page so that you could modify the search criteria. Instead, the user would be taken to whatever happened to be the previous page in the browser&#8217;s history list.  In some cases, they may even have been the previous web site that the user had visited.</p>
<p>More recently though, browsers have exposed object models to help Ajax applications manipulate the browser history artificially so that they can correct the flow of operations as the user uses the forward and back buttons.</p>
 <img src="http://blog.httpwatch.com/wp-content/plugins/feed-statistics.php?view=1&post_id=91" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.httpwatch.com/2008/04/18/the-performance-benefits-of-ajax/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Blocked time and IE 8</title>
		<link>http://blog.httpwatch.com/2008/03/31/blocked-time-and-ie-8/</link>
		<comments>http://blog.httpwatch.com/2008/03/31/blocked-time-and-ie-8/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 17:00:02 +0000</pubDate>
		<dc:creator>Httpwatch Blog</dc:creator>
		
		<category><![CDATA[HTTP]]></category>

		<category><![CDATA[HttpWatch]]></category>

		<category><![CDATA[Internet Explorer]]></category>

		<category><![CDATA[Optimization]]></category>

		<category><![CDATA[Blocked]]></category>

		<category><![CDATA[Connections]]></category>

		<category><![CDATA[IE 8]]></category>

		<category><![CDATA[IE8]]></category>

		<guid isPermaLink="false">http://blog.httpwatch.com/2008/03/31/blocked-time-and-ie-8/</guid>
		<description><![CDATA[A common question we hear from our customers is &#8220;What is the Blocked time in HttpWatch and why are we seeing some much of it?&#8221;
The Blocked time in HttpWatch is shown as a gray block at the start of a request:

We measure this time by looking at the time interval between these two events:

The point [...]]]></description>
			<content:encoded><![CDATA[<p>A common question we hear from our customers is &#8220;What is the <em>Blocked</em> time in HttpWatch and why are we seeing some much of it?&#8221;</p>
<p>The Blocked time in HttpWatch is shown as a gray block at the start of a request:</p>
<p><img src="http://blog.httpwatch.com/wp-content/uploads/2008/03/blocked_time.png" alt="Blocked Time" /></p>
<p>We measure this time by looking at the time interval between these two events:</p>
<ol>
<li>The point at which IE determines that it requires the resource at a certain URL. For example, it may have downloaded some HTML and encountered an &lt;img&gt; tag that refers to a GIF file.</li>
<li>At some later time IE peforms a network action required to download or validate a cached copy of the resource.</li>
</ol>
<p>During this time interval, IE will check the cache to see if the resource is stored locally, determine what headers and cookies would have to be sent in a GET request to the server, and if necessary, wait for an existing connection to become available.</p>
<p>Although, IE is multi-threaded and could start downloading many resources in parallel it is subject to a connection limit per host name. The HTTP 1.1 specification (RFC2616) recommends that HTTP clients should have no more than two connections active per host name. Therefore, a web page that has all its embedded images, CSS and javascript files on the same hostname (e.g. <a href="http://www.example.com/">www.example.com</a>) will only be able to use a maximum of two connections to download content.</p>
<p>Here&#8217;s a screenshot from HttpWatch that shows what happens when you force a refresh (Ctrl+F5) of our home page using IE 7:</p>
<p><img src="http://blog.httpwatch.com/wp-content/uploads/2008/03/ie7_two_connections1.png" alt="Two connections per host in IE 7" /></p>
<p>At any one time, only two HTTP requests are actively downloading content. The rest are in the blocked state waiting for their turn to use one of the two connections to the web server. The two yellow segments in the first two requests indicate that two TCP connections were made to the server (a yellow segment in an HttpWatch time chart indicates the TCP connect time).</p>
<p>For many web pages this has a major performance impact and is a strong motivator for reducing the number of round trips whenever possible.</p>
<p>Microsoft has just released <a href="http://www.microsoft.com/windows/products/winfamily/ie/ie8/default.mspx" title="IE 8 Beta 1">IE 8 Beta 1</a>. One of the most significant changes compared to IE 7 is that the maximum number of connections per host name has been changed. If you are on a fast, broadband connection it now uses a maximum of six rather than two connections per host name.</p>
<p>BTW, if you are going to use HttpWatch with IE 8 Beta 1 please make sure that you download and install version 5.3.</p>
<p>This screen shots shows the six connections being made with IE 8 and the increased concurrency during download:</p>
<p><img src="http://blog.httpwatch.com/wp-content/uploads/2008/03/ie8_six_connections1.png" alt="Six connections per host in IE 8" /></p>
<p>The increase in the number of connections leads to a major reduction in blocked time. We found that the load time for our home page, with an empty cache, is on average 50% less in IE 8 Beta 1 compared to IE 7.</p>
<p><a href="http://stevesouders.com/">Steve Souders</a>, author of <a href="http://www.amazon.com/dp/0596529309?tag=stevsoud-20&amp;camp=14573&amp;creative=327641&amp;linkCode=as1&amp;creativeASIN=0596529309&amp;adid=1S1KP4EV129EN37422C0&amp;">&#8216;High Performance Web Sites&#8217;</a>, has written a blog post entitled <a href="http://www.stevesouders.com/blog/2008/03/20/roundup-on-parallel-connections/" title="Roundup on Parallel Connections">&#8216;Roundup on Parallel Connections&#8217; </a>that discusses the connection limits of other browsers and the possible effect on existing web servers.</p>
 <img src="http://blog.httpwatch.com/wp-content/plugins/feed-statistics.php?view=1&post_id=85" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.httpwatch.com/2008/03/31/blocked-time-and-ie-8/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Printing and IE 8 Support in HttpWatch Version 5.3</title>
		<link>http://blog.httpwatch.com/2008/03/13/printing-and-ie-8-support-in-httpwatch-version-53/</link>
		<comments>http://blog.httpwatch.com/2008/03/13/printing-and-ie-8-support-in-httpwatch-version-53/#comments</comments>
		<pubDate>Thu, 13 Mar 2008 10:00:02 +0000</pubDate>
		<dc:creator>Httpwatch Blog</dc:creator>
		
		<category><![CDATA[HttpWatch]]></category>

		<category><![CDATA[Internet Explorer]]></category>

		<category><![CDATA[IE8]]></category>

		<guid isPermaLink="false">http://blog.httpwatch.com/2008/03/13/printing-and-ie-8-support-in-httpwatch-version-53/</guid>
		<description><![CDATA[Version 5.3 includes printing, print preview, support for IE 8 Beta 1 and several other fixes. The version history contains a detailed list of the changes.
 ]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.httpwatch.com/download/" title="Download version 5.3"><img border="0" align="right" width="110" src="http://blog.httpwatch.com/wp-content/uploads/2008/03/softwareboxsmall.png" hspace="8" alt="softwareboxsmall.png" height="144" /></a><a href="http://www.httpwatch.com/download/" title="Download version 5.3">Version 5.3</a> includes printing, print preview, support for IE 8 Beta 1 and several other fixes. The <a href="http://www.httpwatch.com/download/versionhistory/" title="version history">version history</a> contains a detailed list of the changes.</p>
 <img src="http://blog.httpwatch.com/wp-content/plugins/feed-statistics.php?view=1&post_id=83" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.httpwatch.com/2008/03/13/printing-and-ie-8-support-in-httpwatch-version-53/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Image Caching in Internet Explorer</title>
		<link>http://blog.httpwatch.com/2008/02/27/image-caching-in-internet-explorer/</link>
		<comments>http://blog.httpwatch.com/2008/02/27/image-caching-in-internet-explorer/#comments</comments>
		<pubDate>Wed, 27 Feb 2008 14:21:25 +0000</pubDate>
		<dc:creator>Httpwatch Blog</dc:creator>
		
		<category><![CDATA[Caching]]></category>

		<category><![CDATA[HttpWatch]]></category>

		<category><![CDATA[Internet Explorer]]></category>

		<category><![CDATA[Optimization]]></category>

		<guid isPermaLink="false">http://blog.httpwatch.com/2008/02/27/image-caching-in-internet-explorer/</guid>
		<description><![CDATA[If you build, maintain or tune web sites you&#8217;ll know about the browser cache and how to control caching using HTTP response headers. We&#8217;ve talked about caching in several previous posts.
However, you may not be aware that IE uses two caches for holding images. First, there is the regular browser cache that keeps a copy [...]]]></description>
			<content:encoded><![CDATA[<p>If you build, maintain or tune web sites you&#8217;ll know about the <em>browser cache</em> and how to control caching using HTTP response headers. We&#8217;ve talked about caching in several <a href="http://blog.httpwatch.com/2007/11/05/why-is-google-so-fast/" title="Why is Google so fast?">previous</a> <a href="http://blog.httpwatch.com/2007/12/10/two-simple-rules-for-http-caching/" title="Two simple rules for HTTP caching">posts</a>.</p>
<p>However, you may not be aware that IE uses two caches for holding images. First, there is the regular browser cache that keeps a copy of downloaded image files in your Temporary Internet Files folder. It&#8217;s this cache that can be controlled by HTTP response headers such as Cache-Control and Expires.</p>
<p>There is also an <em>image cache</em> that IE uses to hold recently used images in memory. The main difference between the image cache and the browser cache is:</p>
<ul>
<li>The image cache is never written to disk and is always emptied when IE closes</li>
<li>The image cache contains an expanded, Windows bitmap version of  GIF, JPG or PNG files</li>
<li>HttpWatch does not record access to the image cache, unlike the 304 and (Cache) responses that you&#8217;ll see when IE reads content from the browser cache</li>
</ul>
<p>The point of the image cache is that it can be used to quickly render images without taking the CPU hit required to convert them from their native compressed format into a Windows bitmap.</p>
<p>The only documentation about the image cache is the &#8221;Image Cache Limits&#8221; section of the registry settings for IE on Windows CE:</p>
<p><a href="http://msdn2.microsoft.com/en-us/library/aa908131.aspx">http://msdn2.microsoft.com/en-us/library/aa908131.aspx</a></p>
<p>Here&#8217;s the relevant section:</p>
<p><img src="http://blog.httpwatch.com/wp-content/uploads/2008/02/imagecachingreg.png" alt="Image Caching in Windows CE" /></p>
<p>Although, these settings don&#8217;t work with IE 6 or 7 they do show that the image cache has limits on the size of images, the number of images cached and the maximum amount of memory that can be used. Limits like this have to be set because the expanded images can take up to 500% more memory than the original PNG, GIF or JPG format.</p>
<p>Let&#8217;s see the effect of the image cache by starting a new instance of IE and visting <a href="http://www.httpwatch.com/">www.httpwatch.com</a>:</p>
<p><img src="http://blog.httpwatch.com/wp-content/uploads/2008/02/browsercache.png" alt="Images loaded from browser cache" /></p>
<p>The (Cache) responses shown in HttpWatch indicate that the images on our home page were read from the browser cache.  The image cache would have been empty at this point because IE had just started.</p>
<p>If you click on the Download tab and then click back on the Home page tab you&#8217;ll see that only two images are shown in the resulting HttpWatch trace:</p>
<p><img src="http://blog.httpwatch.com/wp-content/uploads/2008/02/imagecaching.png" alt="Image Caching on HttpWatch home page" /></p>
<p>Clearly, all the images for the home page must have been loaded from somewhere because the page was correctly rendered, but only two images requests from the browser cache are seen in HttpWatch. This is because the other images were read from the image cache.</p>
<p>Why were two of the PNG files still read from the browser cache? These two images are the largest image files on the page and they would expand to approximately 500 KB and 300 KB if they were both placed in the image cache. They probably breached the maximum image size limit in the IE 7 image cache and were therefore not stored in their expanded form.</p>
<p>It&#8217;s also possible to see that the image cache has a limit on the number of images it stores. Try visiting ebay.com and then yahoo.com in the same browser window to load up the image cache. If you then go back to <a href="http://www.httpwatch.com/">www.httpwatch.com</a> you&#8217;ll see that all the images have been flushed out of the image cache and had to be reloaded from the browser cache.</p>
<p>So, to make effective use of the image cache in IE you should:</p>
<ol>
<li>Minimize the number of images that your site uses</li>
<li>Avoid single images that might expand to more than approx 200 KB</li>
</ol>
<p>Of course, you should always try to minimize the number of images to reduce the network round-trips when a browser first loads a page. A popular technique for doing this is to use <a href="http://www.google.com/search?hl=en&amp;q=CSS+sprites&amp;meta=" title="Google results for ">CSS sprites</a> to merge several images together and there are some great <a href="http://spritegen.website-performance.org/" title="CSS Sprite Generator">tools</a> to help you create the compound image.</p>
<p>Be careful though, that you don&#8217;t run into item 2) by creating a single large image that is not loaded into the image cache. You would get the benefit of less round trips on an initial visit, but the rendering in IE might actually be slower because the image would have to expanded from the browser cache whenever it was re-displayed.</p>
 <img src="http://blog.httpwatch.com/wp-content/plugins/feed-statistics.php?view=1&post_id=78" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.httpwatch.com/2008/02/27/image-caching-in-internet-explorer/feed/</wfw:commentRss>
		</item>
		<item>
		<title>New RSS feed for HttpWatch Updates</title>
		<link>http://blog.httpwatch.com/2008/02/05/new-rss-feed-for-httpwatch-updates/</link>
		<comments>http://blog.httpwatch.com/2008/02/05/new-rss-feed-for-httpwatch-updates/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 14:40:26 +0000</pubDate>
		<dc:creator>Httpwatch Blog</dc:creator>
		
		<category><![CDATA[HttpWatch]]></category>

		<guid isPermaLink="false">http://blog.httpwatch.com/2008/02/05/new-rss-feed-for-httpwatch-updates/</guid>
		<description><![CDATA[The downloads page now has its own RSS feed so that you can be notified whenever a new build of HttpWatch is released. You can subscribe to this feed by clicking on this link:
http://www.httpwatch.com/download/versionfeed/
We&#8217;ll continue to announce major and minor version updates here (e.g. 5.0, 5.1, etc) but the new feed will also provide notification of fixes [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.httpwatch.com/download/versionfeed/" title="HttpWatch Version History Feed"><img border="0" align="right" width="28" src="http://blog.httpwatch.com/wp-content/uploads/2008/02/feed-icon-28x28.png" hspace="16" alt="HttpWatch Version History Feed" height="28" /></a>The <a href="http://www.httpwatch.com/download/" title="Download HttpWatch">downloads page</a> now has its own RSS feed so that you can be notified whenever a new build of HttpWatch is released. You can subscribe to this feed by clicking on this link:</p>
<p><a href="http://www.httpwatch.com/download/versionfeed/">http://www.httpwatch.com/download/versionfeed/</a></p>
<p>We&#8217;ll continue to announce major and minor version updates here (e.g. 5.0, 5.1, etc) but the new feed will also provide notification of fixes (e.g. 5.2.14, 5.2.16, etc).</p>
 <img src="http://blog.httpwatch.com/wp-content/plugins/feed-statistics.php?view=1&post_id=76" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.httpwatch.com/2008/02/05/new-rss-feed-for-httpwatch-updates/feed/</wfw:commentRss>
		</item>
		<item>
		<title>What does (Aborted) mean in HttpWatch?</title>
		<link>http://blog.httpwatch.com/2008/01/28/what-does-aborted-mean-in-httpwatch/</link>
		<comments>http://blog.httpwatch.com/2008/01/28/what-does-aborted-mean-in-httpwatch/#comments</comments>
		<pubDate>Mon, 28 Jan 2008 15:56:04 +0000</pubDate>
		<dc:creator>Httpwatch Blog</dc:creator>
		
		<category><![CDATA[HttpWatch]]></category>

		<category><![CDATA[Internet Explorer]]></category>

		<category><![CDATA[IE]]></category>

		<guid isPermaLink="false">http://blog.httpwatch.com/2008/01/28/what-does-aborted-mean-in-httpwatch/</guid>
		<description><![CDATA[The result column in HttpWatch may sometimes display the value (Aborted) instead of an HTTP status code:

(Aborted) is one of three pseudo status codes that are used in HttpWatch to display information about HTTP requests that did not receive a status code from the server:

(Aborted)
(Cache)
ERROR_*

The last two values are fairly straight forward. The (Cache) result is displayed when content [...]]]></description>
			<content:encoded><![CDATA[<p>The result column in HttpWatch may sometimes display the value <em>(Aborted) i</em>nstead of an HTTP <a href="http://www.httpwatch.com/httpgallery/errors/" title="HTTP Status Code">status code</a>:</p>
<p><img src="http://blog.httpwatch.com/wp-content/uploads/2008/01/aborted.png" alt="(Aborted)" /></p>
<p>(Aborted) is one of three <em>pseudo</em> status codes that are used in HttpWatch to display information about HTTP requests that did not receive a status code from the server:</p>
<ul>
<li>(Aborted)</li>
<li>(Cache)</li>
<li>ERROR_*</li>
</ul>
<p>The last two values are fairly straight forward. The (Cache) result is displayed when content is read directly from the browser cache with no network round-trip. If there&#8217;s no network round-trip, there&#8217;s no HTTP status code returned from the server. And the ERROR_* result (e.g.  <a href="http://blog.httpwatch.com/2007/11/20/error_internet_invalid_url-httpwatch/" title="ERROR_INVALID_URL &amp; HttpWatch">ERROR_INVALID_URL</a>) is used when a request fails to complete because an error was detected by Internet Explorer.</p>
<p>The (Aborted) value is more complex in its origin. It occurs when IE has started to process the request for a URL (e.g. to download an image), but then decides to cancel the operation. Here are some examples of when this can occur:</p>
<ol>
<li>If you click on a link or bookmark while a page is downloading, or click on IE&#8217;s Stop button, you will see that IE cancels any requests which are still active and HttpWatch shows the (Aborted) result.</li>
<li>A CSS rollover image on a page will start a request when the mouse pointer is moved into its active area. If the mouse pointer quickly moves away again, IE may abort the request if it has not already completed.</li>
<li>Sometimes javascript is used to fire off requests for background tasks or to gather statistics on a page. Often this can lead to aborted results if the javascript does not wait for the response to be received from the server.</li>
</ol>
<p>A common question is <em>&#8220;Will our server receive requests that ended up being aborted</em>?&#8221;. The answer is that it depends when the request was aborted. By looking at the timing chart in HttpWatch you can determine how far the request was through its normally processing cycle before it was cancelled.</p>
<p>Here&#8217;s an example of a request that was aborted while a connection was being made:</p>
<p><img src="http://blog.httpwatch.com/wp-content/uploads/2008/01/abort_notsent.png" alt="Aborted while connecting" /></p>
<p>The server would not have received the HTTP request message in this case, because the <em>Send</em> state was not reached.</p>
<p>The request shown below was aborted when IE was awaiting a response and therefore the request would have been delivered to the server:</p>
<p><img src="http://blog.httpwatch.com/wp-content/uploads/2008/01/abort_sent.png" alt="Aborted while waiting" /></p>
<p>The presence of an (Aborted) entry in an HttpWatch log file is often just a consequence of the way that the user is interacting with a web site, rather than an indication that something has gone wrong.</p>
 <img src="http://blog.httpwatch.com/wp-content/plugins/feed-statistics.php?view=1&post_id=72" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.httpwatch.com/2008/01/28/what-does-aborted-mean-in-httpwatch/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The Performance Impact of Uploaded Data</title>
		<link>http://blog.httpwatch.com/2008/01/18/the-performance-impact-of-uploaded-data/</link>
		<comments>http://blog.httpwatch.com/2008/01/18/the-performance-impact-of-uploaded-data/#comments</comments>
		<pubDate>Fri, 18 Jan 2008 11:13:48 +0000</pubDate>
		<dc:creator>Httpwatch Blog</dc:creator>
		
		<category><![CDATA[Caching]]></category>

		<category><![CDATA[HTTP]]></category>

		<category><![CDATA[HttpWatch]]></category>

		<category><![CDATA[Optimization]]></category>

		<guid isPermaLink="false">http://blog.httpwatch.com/2008/01/18/the-performance-impact-of-uploaded-data/</guid>
		<description><![CDATA[Web developers are becoming more aware of the performance penalties of page bloat and as we covered in our previous posts there are ways to mitigate this, compression being just one.
However, one of the causes of poor performance that is often overlooked is the transmission time taken to upload data to the server. Although, HTTP request [...]]]></description>
			<content:encoded><![CDATA[<p>Web developers are becoming more aware of the performance penalties of page bloat and as we covered in our previous <a href="http://blog.httpwatch.com/2007/11/05/why-is-google-so-fast/" title="http://blog.httpwatch.com/2007/11/05/why-is-google-so-fast/">posts</a> there are ways to mitigate this, compression being just one.</p>
<p>However, one of the causes of poor performance that is often overlooked is the transmission time taken to <em>upload</em> data to the server. Although, HTTP request messages are typically smaller than HTTP response messages, the performance cost can be an order of magnitude higher per byte. This is caused by the asymmetric nature of many consumer broadband connections.</p>
<p>For example, the results of a <a href="http://www.thinkbroadband.com/speedtest.html" title="Broadband Speed Test">speed test</a> on a UK broadband cable connection are shown here:</p>
<p><img src="http://blog.httpwatch.com/wp-content/uploads/2008/01/cablespeed1.png" alt="Broadband Speed Test" /></p>
<p>The upload speed is only about 6% of the download speed. That means, byte for byte, uploaded data takes about 16 times as long to transmit as the equivalent amount of downloaded data.</p>
<p>To put it another way, if you upload 4 KB of data in an HTTP request message it may take the same length of time as downloading a 64 KB page.</p>
<p>You can easily see the size of the HTTP request message by looking at the Sent column in HttpWatch:</p>
<p> <img src="http://blog.httpwatch.com/wp-content/uploads/2008/01/sent_col1.png" alt="Sent Column" /></p>
<p>The value shown in the Sent Column is made up of the size of the following items:</p>
<ul type="disc">
<li>The HTTP GET or POST request line</li>
<li>HTTP request headers</li>
<li>Form fields and uploaded files sent with POST requests</li>
</ul>
<p>Unfortunately, request data is never compressed because there is no server-side equivalent of the <code>Accept-Encoding</code> request header that is used by browsers to indicate that they support compression of downloaded content.</p>
<p>For a typical site, you might be surprised to know that the request data can be up to 50% of the size of the response data. Since many broadband connections are asymmetric, this can have a substantial impact on performance. Here&#8217;s an example of a flight search page on Expedia:</p>
<p><img src="http://blog.httpwatch.com/wp-content/uploads/2008/01/search_flight.png" alt="Upload / Download Ratio" /></p>
<p>The ratio increases as the downloaded content is cached by the browser, often making uploaded data the most significant factor in the performance of a web page.</p>
<p>So what can be done to reduce the amount of uploaded data?</p>
<h3>Step 1: Minimize the size of Cookies</h3>
<p>Cookies are simply part of the request headers. Expedia uses around 9 cookies which are fortunately quite small but it&#8217;s easily possible to end up with a lot of cookie data, particularly if you&#8217;re using 3<sup>rd</sup> party web frameworks. <a href="http://www.ietf.org/rfc/rfc2109.txt" title="HTTP State Management Mechanism">RFC2109</a> specifies that browsers should support at least 20 cookies for each domain and at least 4K of data per cookie.</p>
<p>The problem with cookies is that they need to be sent with every single HTTP request where the URL is in the domain and path to which they apply. That includes requests for style-sheets, images and scripts.  So in most cases the amount of cookie data uploaded, is effectively multiplied by the number of requests per page.</p>
<p>One way to reduce the amount of cookie data (apart from making them as small as possible and using them less) is to use different domains or paths for your content. For instance, you probably need cookies in your page processing code but you don&#8217;t need them for static content such as images. If you put static content in a different location, cookie data will not be sent because cookies are domain and path specific.</p>
<p>Another way to reduce cookie data is to look at server-side storage, such as using the session state management of a framework like ASP.NET. You can then use a single cookie that just contains a session id and look up any session related data on the server when required. Of course, this may have an impact on server side performance, but it is a useful way of minimizing the amount of cookie data that a site requires.</p>
<h3>Step 2: Avoid Excessive use of Hidden Form Fields</h3>
<p>There are two sets of data in a typical HTML form:</p>
<ol>
<li>Fields you want the user to fill out with information.</li>
<li>Hidden fields.</li>
</ol>
<p>You can&#8217;t really do much about the first type, except reducing the size of your field names. This may be difficult depending on your implementation framework.</p>
<p>Hidden fields are used to maintain page-scoped variables that will be required by the server when the form is submitted, e.g. a user ID. They may also be injected by various web frameworks or server-side controls. One such example is the <a href="http://msdn.microsoft.com/msdnmag/issues/03/02/CuttingEdge/" title="http://msdn.microsoft.com/msdnmag/issues/03/02/CuttingEdge/">__VIEWSTATE</a> field used by ASP.NET as shown below:</p>
<p><img src="http://blog.httpwatch.com/wp-content/uploads/2008/01/hiddenfields.png" alt="ASP.NET hidden fields" /></p>
<p>There are two reasons for doing this. Firstly it&#8217;s easier to have the state to hand (so to speak) in your page logic and secondly it often scales better across a web farm by keeping page scoped state within the page rather than fetching it from somewhere else like a database. </p>
<p>One way to reduce the amount of data in hidden fields is to only use a single key in a hidden form field. The key value is then used on the server to retrieve the data required to process the submitted page. This is exactly like the approach used to reduce the amount of cookie data.  And like with cookies, reducing request transmission time in this way may have an impact on server-side performance and scalability.</p>
<h3>Step 3: Avoid Verbose URLs</h3>
<p>This is not the most important issue on the list, but it is still worth considering. In practice there are no ubiquitous limits on URL length, but most browsers will struggle with URLs longer than 4 KB - some may struggle at 1 KB or less. Remember that your URL will also end up in the referrer header of images and other embedded resources.</p>
<p>It&#8217;s usually the query string parameters that make a URL overly long. Again using Expedia as an example, you can see how many sites use these variables:</p>
<p><code>http://www.expedia.com/pub/agent.dll?qscr=fexp&amp;flag=q&amp;city1=lon&amp;citd1=bos&amp;date1=1/22/2008&amp;time1=362&amp;<br />
date2=1/22/2008&amp;time2=362&amp;cAdu=1&amp;cSen=&amp;cChi=&amp;cInf=&amp;infs=2&amp;<br />
tktt=&amp;trpt=2&amp;ecrc=&amp;eccn=&amp;qryt=8&amp;load=1&amp;airp1=&amp;dair1=&amp;rdct=1&amp;<br />
rfrr=-429</code></p>
<p>In this case the URL is used to quickly pinpoint a results page for flights between ‘city1&#8242; London (LON) and ‘city2&#8242; Boston (BOS) on specific dates.</p>
<p>Encoding data like this in URLs does have certain advantages. If you bookmark or share the URL the same results will be displayed when the URL is next used. However, if the URL contains unused or redundant data it may be causing a significant increase in the amount of uploaded data.</p>
 <img src="http://blog.httpwatch.com/wp-content/plugins/feed-statistics.php?view=1&post_id=65" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.httpwatch.com/2008/01/18/the-performance-impact-of-uploaded-data/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Two Simple Rules for HTTP Caching</title>
		<link>http://blog.httpwatch.com/2007/12/10/two-simple-rules-for-http-caching/</link>
		<comments>http://blog.httpwatch.com/2007/12/10/two-simple-rules-for-http-caching/#comments</comments>
		<pubDate>Mon, 10 Dec 2007 17:45:03 +0000</pubDate>
		<dc:creator>Httpwatch Blog</dc:creator>
		
		<category><![CDATA[Caching]]></category>

		<category><![CDATA[HTTP]]></category>

		<category><![CDATA[HttpWatch]]></category>

		<guid isPermaLink="false">http://blog.httpwatch.com/2007/12/10/two-simple-rules-for-http-caching/</guid>
		<description><![CDATA[In practice, you only need two settings to optimize caching:

Don&#8217;t cache HTML
Cache everything else forever

&#8220;Wooah&#8230;hang on!&#8221;, we hear you say. &#8220;Cache all my scripts and images forever?&#8220;
Yes, that&#8217;s right. You don&#8217;t need anything else in between. Caching indefinitely is fine as long as you don&#8217;t allow your HTML to be cached.
&#8220;But what about if I [...]]]></description>
			<content:encoded><![CDATA[<p>In practice, you only need two settings to optimize caching:</p>
<ol>
<li>Don&#8217;t cache HTML</li>
<li>Cache everything else forever</li>
</ol>
<p>&#8220;Wooah<em>&#8230;hang on!&#8221;, </em>we hear you say.<em> &#8220;Cache all my scripts and images <u>forever?</u>&#8220;</em></p>
<p>Yes, that&#8217;s right. You don&#8217;t need anything else in between. Caching indefinitely is fine as long as you don&#8217;t allow your HTML to be cached.</p>
<p><em>&#8220;But what about if I need to issue code patches to my JavaScript? I can&#8217;t allow<strong> </strong>browsers to hold on to all my images either. I often need to update those as well.&#8221;</em></p>
<p>Simple - just change the URL of the item in your HTML and it will bypass the existing entry in the cache.</p>
<p>In practice, caching ‘forever&#8217; typically means setting an <code>Expires</code> header value of <code>Sun, 17-Jan-2038 19:14:07 GMT</code> since that&#8217;s the maximum value supported by the 32 bit Unix time/date format. If you&#8217;re using IIS6 you&#8217;ll find that the UI won&#8217;t allow anything beyond 31-Dec-2035. The advantage of setting long expiry dates is that the content can be read from the local browser cache whenever the user revisits the web page or goes to another page that uses the same images, script or CSS files.</p>
<p>You&#8217;ll see long expiry dates like this if you look at a Google web page with HttpWatch. For example, here are the response headers used for the main Google logo on the home page:</p>
<p><img src="http://blog.httpwatch.com/wp-content/uploads/2007/12/google_expires.png" alt="Google Expires header" /></p>
<p>If Google needs to change the logo for a special occasion like Halloween they just change the name of the file in the page&#8217;s HTML to something like halloween2007.gif.</p>
<p>The diagram below shows how a JavaScript file is loaded into the browser cache on the first visit to a web page:</p>
<p><img src="http://blog.httpwatch.com/wp-content/uploads/2007/12/cache_first_get.png" alt="Accessing page with empty cache" /></p>
<p>On any subsequent visits the browser only has to fetch the page&#8217;s HTML:</p>
<p><img src="http://blog.httpwatch.com/wp-content/uploads/2007/12/cache_second_get.png" alt="Read from cache" /></p>
<p>The JavaScript file can be read directly from the browser cache on the user&#8217;s hard disk. This avoids a network round trip and is typically 100 to 1000 times faster than downloading the file over a broadband connection.</p>
<p>The key to this caching scheme is to keep tight control over your HTML as it holds the references to everything else on your web site. One way to do this is to ensure that your pages have a <code>Cache-Control: no-cache</code> header. This will prevent any caching of the HTML and will ensure the browser requests the page&#8217;s HTML every time.</p>
<p>If you do this, you can update any content on the page just by changing the URL that refers to it in the HTML. The old version will still be in the browser&#8217;s cache, but the updated version will be downloaded because of the modified URL.</p>
<p>For instance, if you had a file called topMenu.js and you fixed some bugs in it, you might rename the file topMenu-v2.js to force it to be downloaded:</p>
<p><img src="http://blog.httpwatch.com/wp-content/uploads/2007/12/cache_get_new_url.png" alt="Force update with new file name" /></p>
<p>Now this is all very well, but whenever there&#8217;s a discussion of longer expiration times, the marketing people get very twitchy and concerned that they won&#8217;t be able to re-brand a site if stylesheets and images are cached for long periods of time.</p>
<p>In fact, choosing an expiration time of anything other than zero or infinite is inherently uncertain. The only way to know exactly when you can release a new version to all users simultaneously is to choose a specific time of day for your cache expiry; say midnight. It&#8217;s better to set indefinite caching on all your page-linked items so that you get the maximum amount of caching, and then force updates as required.</p>
<p>Now, by this point, you might have the marketing types on board but you&#8217;ll be losing the developers. The developers by now are seeing all the extra work involved in changing the filenames of all their CSS, javascript and images both in their source controlled projects and in their deployment scripts.</p>
<p>So here&#8217;s the icing on the cake; you don&#8217;t actually <em>need</em> to change the filename, just the URL. A simple way to do this is to append a query string parameter onto the end of the existing URL when the resource has changed.</p>
<p>Here&#8217;s the previous example that updated a JavaScript file. The difference this time is that it uses a query string parameter &#8216;v2&#8242; to bypass the existing cache entry:</p>
<p><img border="0" vspace="8" src="http://blog.httpwatch.com/wp-content/uploads/2007/12/cache_get_query_string.png" alt="Force update with query string" /></p>
<p>The web server will simply ignore the query string parameter unless you have chosen to do anything with it programmatically.</p>
<p>There&#8217;s one final optimization you can make. The <code>Cache-Control: no-cache</code> response header works well for dynamic pages as it ensures that pages will always be refreshed from the server; even when pressing the Back button. However, for HTML that changes less frequently it is better to use the <code>Last-Modified</code> header instead. This will avoid a complete download of the page&#8217;s HTML, if it has not changed since it was last cached by the browser.</p>
<p>The <code>Last-Modified</code> header is added automatically by IIS for static HTML files and can be added programmatically in dynamic pages (e.g. ASPX and PHP). When this header is present, the browser will revalidate the local, cached copy of an HTML page in each new browser session. If the page is unchanged the web server returns a <code>304 Not Modified</code> response indicating the browser can use the cached version of the page.</p>
<p><strong>So to summarize:</strong></p>
<ol>
<li>Don&#8217;t cache HTML
<ul>
<li>Use <code>Cache-Control: no-cache</code> for dynamic HTML pages</li>
<li>Use the <code>Last-Modified</code> header with the current file time for static HTML</li>
</ul>
</li>
<li>Cache everything else forever
<ul>
<li>For all other file types set an <code>Expires</code> header to the maximum future date your web server will allow</li>
</ul>
</li>
<li>Modify URLs by appending a query string in your HTML to any page element you wish to ‘expire&#8217; immediately.</li>
</ol>
 <img src="http://blog.httpwatch.com/wp-content/plugins/feed-statistics.php?view=1&post_id=52" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.httpwatch.com/2007/12/10/two-simple-rules-for-http-caching/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
