<?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>webscale &#187; JsonResult Cache</title>
	<atom:link href="http://www.simnova.com/blog/index.php/tag/jsonresult-cache/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.simnova.com/blog</link>
	<description>Web 2.0 and beyond</description>
	<lastBuildDate>Sat, 13 Feb 2010 04:10:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>ASP.NET MVC &#8211; JsonResult &#8211; Preventing Caching</title>
		<link>http://www.simnova.com/blog/index.php/2010/01/13/asp-net-mvc-jsonresult-preventing-caching/</link>
		<comments>http://www.simnova.com/blog/index.php/2010/01/13/asp-net-mvc-jsonresult-preventing-caching/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 18:25:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[JsonResult Cache]]></category>

		<guid isPermaLink="false">http://www.simnova.com/blog/index.php/2010/01/13/asp-net-mvc-jsonresult-preventing-caching/</guid>
		<description><![CDATA[I came across a scenario where I did not want JSON to be cached, the following code did the trick:
public JsonResult ListJson()   {    &#160;&#160;&#160; Response.CacheControl = &#34;no-cache&#34;;    &#160;&#160;&#160; Response.Cache.SetETag(((ShortGuid)Guid.NewGuid()).ToString());
&#160;
FYI I’m using ShortGuid from Dave Transom

  addthis_url    = 'http%3A%2F%2Fwww.simnova.com%2Fblog%2Findex.php%2F2010%2F01%2F13%2Fasp-net-mvc-jsonresult-preventing-caching%2F';
  addthis_title  = 'ASP.NET+MVC+%26ndash%3B+JsonResult+%26ndash%3B+Preventing+Caching';
 [...]]]></description>
			<content:encoded><![CDATA[<p>I came across a scenario where I did not want JSON to be cached, the following code did the trick:</p>
<p>public JsonResult ListJson()   <br />{    <br />&#160;&#160;&#160; Response.CacheControl = &quot;no-cache&quot;;    <br />&#160;&#160;&#160; Response.Cache.SetETag(((ShortGuid)Guid.NewGuid()).ToString());</p>
<p>&#160;</p>
<p>FYI I’m using <a href="http://www.singular.co.nz/blog/archive/2007/12/20/shortguid-a-shorter-and-url-friendly-guid-in-c-sharp.aspx" target="_blank">ShortGuid</a> from <a href="http://www.singular.co.nz/blog/" target="_blank">Dave Transom</a></p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.simnova.com%2Fblog%2Findex.php%2F2010%2F01%2F13%2Fasp-net-mvc-jsonresult-preventing-caching%2F';
  addthis_title  = 'ASP.NET+MVC+%26ndash%3B+JsonResult+%26ndash%3B+Preventing+Caching';
  addthis_pub    = 'webscale';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.simnova.com/blog/index.php/2010/01/13/asp-net-mvc-jsonresult-preventing-caching/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
