<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: How to stop IE from caching AJAX requests</title>
	<atom:link href="http://www.rawseo.com/news/2009/04/02/how-to-stop-ie-from-caching-ajax-requests/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rawseo.com/news/2009/04/02/how-to-stop-ie-from-caching-ajax-requests/</link>
	<description>A blend of programming and seo</description>
	<lastBuildDate>Tue, 23 Mar 2010 05:55:58 -0400</lastBuildDate>
	
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: ??????? &#187; [Web] ????</title>
		<link>http://www.rawseo.com/news/2009/04/02/how-to-stop-ie-from-caching-ajax-requests/comment-page-1/#comment-306</link>
		<dc:creator>??????? &#187; [Web] ????</dc:creator>
		<pubDate>Thu, 09 Apr 2009 02:57:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.rawseo.com/news/?p=537#comment-306</guid>
		<description>[...] How to stop IE from caching AJAX requests [...]</description>
		<content:encoded><![CDATA[<p>[...] How to stop IE from caching AJAX requests [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rahul Batra</title>
		<link>http://www.rawseo.com/news/2009/04/02/how-to-stop-ie-from-caching-ajax-requests/comment-page-1/#comment-138</link>
		<dc:creator>Rahul Batra</dc:creator>
		<pubDate>Fri, 03 Apr 2009 17:34:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.rawseo.com/news/?p=537#comment-138</guid>
		<description>In 2nd solution, you could&#039;ve simply used Math.random() to generate a unique identifier.</description>
		<content:encoded><![CDATA[<p>In 2nd solution, you could&#8217;ve simply used Math.random() to generate a unique identifier.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: thezilch</title>
		<link>http://www.rawseo.com/news/2009/04/02/how-to-stop-ie-from-caching-ajax-requests/comment-page-1/#comment-126</link>
		<dc:creator>thezilch</dc:creator>
		<pubDate>Fri, 03 Apr 2009 07:06:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.rawseo.com/news/?p=537#comment-126</guid>
		<description>Somewhat related, IE will use a cached request if POSTing with a Content-Length of 0 -- a POST with no data. We had a case where a GET and POST were made on the same URL. IE would use the cached, GET response for a POST request, when no data accompanied the request. Cache-Control header to the rescue.

As for a client-side GET solution, using a header:

xmlHttp = createXMLHttpRequest();
xmlHttp.onreadystatechange = handleMessages;
xmlHttp.open(â€GETâ€,â€script.php?&quot;,true);
xmlHttp.setRequestHeader(&quot;Cache-Control&quot;,&quot;no-cache, private, max-age=0&quot;);
xmlHttp.send(null);</description>
		<content:encoded><![CDATA[<p>Somewhat related, IE will use a cached request if POSTing with a Content-Length of 0 &#8212; a POST with no data. We had a case where a GET and POST were made on the same URL. IE would use the cached, GET response for a POST request, when no data accompanied the request. Cache-Control header to the rescue.</p>
<p>As for a client-side GET solution, using a header:</p>
<p>xmlHttp = createXMLHttpRequest();<br />
xmlHttp.onreadystatechange = handleMessages;<br />
xmlHttp.open(â€GETâ€,â€script.php?&#8221;,true);<br />
xmlHttp.setRequestHeader(&#8221;Cache-Control&#8221;,&#8221;no-cache, private, max-age=0&#8243;);<br />
xmlHttp.send(null);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jack Arse</title>
		<link>http://www.rawseo.com/news/2009/04/02/how-to-stop-ie-from-caching-ajax-requests/comment-page-1/#comment-119</link>
		<dc:creator>Jack Arse</dc:creator>
		<pubDate>Thu, 02 Apr 2009 19:33:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.rawseo.com/news/?p=537#comment-119</guid>
		<description>You could also use POST instead of GET as IE doesn&#039;t cache that.</description>
		<content:encoded><![CDATA[<p>You could also use POST instead of GET as IE doesn&#8217;t cache that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tedivm</title>
		<link>http://www.rawseo.com/news/2009/04/02/how-to-stop-ie-from-caching-ajax-requests/comment-page-1/#comment-118</link>
		<dc:creator>tedivm</dc:creator>
		<pubDate>Thu, 02 Apr 2009 19:28:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.rawseo.com/news/?p=537#comment-118</guid>
		<description>Try these headers instead-

header( â€œLast-Modified: â€ . gmdate( â€œD, d M y H:i:s Tâ€, time() + 3600));

By putting this a little bit in the future you can make up for the fact that some people&#039;s clocks aren&#039;t synced with yours. Alternatively, you could simply remove this header altogether, as without a validation most systems won&#039;t cache.


header( â€œCache-Control: no-cache, must-revalidate, no-store, max-age=0â€ );

An important note on Cache-Control- the &quot;no-cache&quot; attribute just tells the client not to give out the content without checking back with the server, while the &quot;no-store&quot; attribute tells the client not to even bother storing the content at all.

This website is a great resource for this- http://www.mnot.net/cache_docs

One final note- sometimes apache will add additional headers. You may want to use something like the firefox &quot;liveheaders&quot; plugin to see what your server is sending back.</description>
		<content:encoded><![CDATA[<p>Try these headers instead-</p>
<p>header( â€œLast-Modified: â€ . gmdate( â€œD, d M y H:i:s Tâ€, time() + 3600));</p>
<p>By putting this a little bit in the future you can make up for the fact that some people&#8217;s clocks aren&#8217;t synced with yours. Alternatively, you could simply remove this header altogether, as without a validation most systems won&#8217;t cache.</p>
<p>header( â€œCache-Control: no-cache, must-revalidate, no-store, max-age=0â€ );</p>
<p>An important note on Cache-Control- the &#8220;no-cache&#8221; attribute just tells the client not to give out the content without checking back with the server, while the &#8220;no-store&#8221; attribute tells the client not to even bother storing the content at all.</p>
<p>This website is a great resource for this- <a href="http://www.mnot.net/cache_docs" rel="nofollow">http://www.mnot.net/cache_docs</a></p>
<p>One final note- sometimes apache will add additional headers. You may want to use something like the firefox &#8220;liveheaders&#8221; plugin to see what your server is sending back.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
