<?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"
	>
<channel>
	<title>Comments on: Client HTTP Caching in Rails</title>
	<atom:link href="http://www.igvita.com/2007/03/07/client-http-caching-in-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.igvita.com/2007/03/07/client-http-caching-in-rails/</link>
	<description>A goal is a dream with a deadline.</description>
	<pubDate>Fri, 29 Aug 2008 03:21:37 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Dan Kubb</title>
		<link>http://www.igvita.com/2007/03/07/client-http-caching-in-rails/#comment-90179</link>
		<dc:creator>Dan Kubb</dc:creator>
		<pubDate>Wed, 21 Nov 2007 03:14:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.igvita.com/blog/2007/03/07/client-http-caching-in-rails/#comment-90179</guid>
		<description>Since this article was published a new plugin called &lt;a href="http://blog.labnotes.org/2007/09/05/restfully_yours-good-things-happen-to-those-who-rest/" rel="nofollow"&gt;restfully_yours&lt;/a&gt; has appeared.  It provides a nice clean way to handle Conditional GET within your Rails app.</description>
		<content:encoded><![CDATA[<p>Since this article was published a new plugin called <a href="http://blog.labnotes.org/2007/09/05/restfully_yours-good-things-happen-to-those-who-rest/" rel="nofollow">restfully_yours</a> has appeared.  It provides a nice clean way to handle Conditional GET within your Rails app.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Morning Brew #10</title>
		<link>http://www.igvita.com/2007/03/07/client-http-caching-in-rails/#comment-39576</link>
		<dc:creator>Morning Brew #10</dc:creator>
		<pubDate>Thu, 24 May 2007 11:06:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.igvita.com/blog/2007/03/07/client-http-caching-in-rails/#comment-39576</guid>
		<description>[...] Status 304 - send HTTP 304 instead (another take) [...]</description>
		<content:encoded><![CDATA[<p>[...] Status 304 - send HTTP 304 instead (another take) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ilya Grigorik</title>
		<link>http://www.igvita.com/2007/03/07/client-http-caching-in-rails/#comment-28258</link>
		<dc:creator>Ilya Grigorik</dc:creator>
		<pubDate>Fri, 23 Mar 2007 02:40:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.igvita.com/blog/2007/03/07/client-http-caching-in-rails/#comment-28258</guid>
		<description>Yeah, I guess that's true. Come to think of it, even my solution might result in a DB hit with Edge rails and ETag support. I wonder if you can bypass the filter?</description>
		<content:encoded><![CDATA[<p>Yeah, I guess that&#8217;s true. Come to think of it, even my solution might result in a DB hit with Edge rails and ETag support. I wonder if you can bypass the filter?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SRobertJames</title>
		<link>http://www.igvita.com/2007/03/07/client-http-caching-in-rails/#comment-27753</link>
		<dc:creator>SRobertJames</dc:creator>
		<pubDate>Wed, 21 Mar 2007 18:16:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.igvita.com/blog/2007/03/07/client-http-caching-in-rails/#comment-27753</guid>
		<description>&#62;James, you can take advantage of full ETag support by switching to edge rails. It’s committed and working..

I think Edge Rails will still hit the DB, just not the network... your solution skips even that.</description>
		<content:encoded><![CDATA[<p>&gt;James, you can take advantage of full ETag support by switching to edge rails. It’s committed and working..</p>
<p>I think Edge Rails will still hit the DB, just not the network&#8230; your solution skips even that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ilya Grigorik</title>
		<link>http://www.igvita.com/2007/03/07/client-http-caching-in-rails/#comment-27721</link>
		<dc:creator>Ilya Grigorik</dc:creator>
		<pubDate>Wed, 21 Mar 2007 16:21:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.igvita.com/blog/2007/03/07/client-http-caching-in-rails/#comment-27721</guid>
		<description>James, you can take advantage of full ETag support by switching to edge rails. It's committed and working..

In terms of testing, check out this article by Yahoo guys: &lt;a href="http://yuiblog.com/blog/2007/01/04/performance-research-part-2/" rel="nofollow"&gt;Performance Research&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>James, you can take advantage of full ETag support by switching to edge rails. It&#8217;s committed and working..</p>
<p>In terms of testing, check out this article by Yahoo guys: <a href="http://yuiblog.com/blog/2007/01/04/performance-research-part-2/" rel="nofollow">Performance Research</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SRobertJames</title>
		<link>http://www.igvita.com/2007/03/07/client-http-caching-in-rails/#comment-27409</link>
		<dc:creator>SRobertJames</dc:creator>
		<pubDate>Tue, 20 Mar 2007 19:45:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.igvita.com/blog/2007/03/07/client-http-caching-in-rails/#comment-27409</guid>
		<description>Thanks for this post.  Did you ever get etag / if-match / if-none-match working?

Also, is there any simple way to test that browser's are actually using the cache?</description>
		<content:encoded><![CDATA[<p>Thanks for this post.  Did you ever get etag / if-match / if-none-match working?</p>
<p>Also, is there any simple way to test that browser&#8217;s are actually using the cache?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ilya Grigorik</title>
		<link>http://www.igvita.com/2007/03/07/client-http-caching-in-rails/#comment-27102</link>
		<dc:creator>Ilya Grigorik</dc:creator>
		<pubDate>Tue, 20 Mar 2007 01:55:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.igvita.com/blog/2007/03/07/client-http-caching-in-rails/#comment-27102</guid>
		<description>James, that could work for &lt;em&gt;some&lt;/em&gt; apps. Most applications have a layer of 'personalization' that makes external caches impractical. If you avoid personalized content, then yeah that could work! In fact, then your suggestion is the ideal case - i.e. just throw some memcached servers between apache and your app server, or get apache to do all the work by itself.</description>
		<content:encoded><![CDATA[<p>James, that could work for <em>some</em> apps. Most applications have a layer of &#8216;personalization&#8217; that makes external caches impractical. If you avoid personalized content, then yeah that could work! In fact, then your suggestion is the ideal case - i.e. just throw some memcached servers between apache and your app server, or get apache to do all the work by itself.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SRobertJames</title>
		<link>http://www.igvita.com/2007/03/07/client-http-caching-in-rails/#comment-25991</link>
		<dc:creator>SRobertJames</dc:creator>
		<pubDate>Fri, 16 Mar 2007 20:14:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.igvita.com/blog/2007/03/07/client-http-caching-in-rails/#comment-25991</guid>
		<description>Perhaps the best approach is to have Rails support etag/ conditional get, and not cache anything itself - and then turn mod_cache on in Apache.

Push the cache storage layer to the web server - keeps the app simple.  And Apache's the expert on HTTP.</description>
		<content:encoded><![CDATA[<p>Perhaps the best approach is to have Rails support etag/ conditional get, and not cache anything itself - and then turn mod_cache on in Apache.</p>
<p>Push the cache storage layer to the web server - keeps the app simple.  And Apache&#8217;s the expert on HTTP.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ilya Grigorik</title>
		<link>http://www.igvita.com/2007/03/07/client-http-caching-in-rails/#comment-25911</link>
		<dc:creator>Ilya Grigorik</dc:creator>
		<pubDate>Fri, 16 Mar 2007 15:19:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.igvita.com/blog/2007/03/07/client-http-caching-in-rails/#comment-25911</guid>
		<description>Yep, that's exactly what I'm thinking. If the DB query is extremely expensive, you could even have a separate sql query:
&lt;blockquote&gt;&lt;code&gt;select created_at from ...&lt;/code&gt;&lt;/blockquote&gt;
Then you could compare the ETag flags and decide where to go from there. In this case, 7580 could be very useful.

However, I certainly don't want to make it sound like ETag / Conditional-Get is &lt;strong&gt;the way&lt;/strong&gt; to boost your performance. Any form of an additional caching layer should blow this technique right out of the water. However, even then, conditional-get can serve as a nice fallback technique for cheap optimization. For example, if you can't  cache every single query in memory (limited size), some items will be periodically removed from the cache and have to be re-executed. Hence, cache layer fails, but ETags could take over and tell the client to use the local copy.</description>
		<content:encoded><![CDATA[<p>Yep, that&#8217;s exactly what I&#8217;m thinking. If the DB query is extremely expensive, you could even have a separate sql query:</p>
<blockquote><p><code>select created_at from ...</code></p></blockquote>
<p>Then you could compare the ETag flags and decide where to go from there. In this case, 7580 could be very useful.</p>
<p>However, I certainly don&#8217;t want to make it sound like ETag / Conditional-Get is <strong>the way</strong> to boost your performance. Any form of an additional caching layer should blow this technique right out of the water. However, even then, conditional-get can serve as a nice fallback technique for cheap optimization. For example, if you can&#8217;t  cache every single query in memory (limited size), some items will be periodically removed from the cache and have to be re-executed. Hence, cache layer fails, but ETags could take over and tell the client to use the local copy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Kubb</title>
		<link>http://www.igvita.com/2007/03/07/client-http-caching-in-rails/#comment-25642</link>
		<dc:creator>Dan Kubb</dc:creator>
		<pubDate>Thu, 15 Mar 2007 20:45:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.igvita.com/blog/2007/03/07/client-http-caching-in-rails/#comment-25642</guid>
		<description>Ilya, good catch -- I mistyped that, but I couldn't change it after I submitted it.

Changeset 7580 is great, and I think if you've got to actually perform the action and its associated DB work, then setting your own ETag and making use of this is the way to go.

I've been thinking that if there was a way for you to "register" the models you're going to use in the view, you could extract their lock_version and created_at values (assuming they exist) to automatically set the ETag and Last-Modified headers.  This would skip rendering of the view and make good use of what 7580 provides.

Still, action_cache is going to blow this technique out of the water (and page caching even more so) since it happens before the action is even run, but it may not always be practical.  The earlier in the request chain you can determine if the browser cache is still valid the better the performance will be.</description>
		<content:encoded><![CDATA[<p>Ilya, good catch &#8212; I mistyped that, but I couldn&#8217;t change it after I submitted it.</p>
<p>Changeset 7580 is great, and I think if you&#8217;ve got to actually perform the action and its associated DB work, then setting your own ETag and making use of this is the way to go.</p>
<p>I&#8217;ve been thinking that if there was a way for you to &#8220;register&#8221; the models you&#8217;re going to use in the view, you could extract their lock_version and created_at values (assuming they exist) to automatically set the ETag and Last-Modified headers.  This would skip rendering of the view and make good use of what 7580 provides.</p>
<p>Still, action_cache is going to blow this technique out of the water (and page caching even more so) since it happens before the action is even run, but it may not always be practical.  The earlier in the request chain you can determine if the browser cache is still valid the better the performance will be.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.237 seconds -->
<!-- Cached page served by WP-Cache -->
<!-- Compression = gzip -->