From db354204b7656b010630448248b112ce39c4cf41 Mon Sep 17 00:00:00 2001
From: Guillermo Iguaran <guilleiguaran@gmail.com>
Date: Mon, 3 Sep 2012 16:52:08 -0500
Subject: Update caching guide: memcache-client was replaced with dalli

---
 guides/source/caching_with_rails.textile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'guides/source/caching_with_rails.textile')

diff --git a/guides/source/caching_with_rails.textile b/guides/source/caching_with_rails.textile
index 815b2ef9c2..f6d6c8b550 100644
--- a/guides/source/caching_with_rails.textile
+++ b/guides/source/caching_with_rails.textile
@@ -353,7 +353,7 @@ Note that the cache will grow until the disk is full unless you periodically cle
 
 h4. ActiveSupport::Cache::MemCacheStore
 
-This cache store uses Danga's +memcached+ server to provide a centralized cache for your application. Rails uses the bundled +memcache-client+ gem by default. This is currently the most popular cache store for production websites. It can be used to provide a single, shared cache cluster with very a high performance and redundancy.
+This cache store uses Danga's +memcached+ server to provide a centralized cache for your application. Rails uses the bundled +dalli+ gem by default. This is currently the most popular cache store for production websites. It can be used to provide a single, shared cache cluster with very a high performance and redundancy.
 
 When initializing the cache, you need to specify the addresses for all memcached servers in your cluster. If none is specified, it will assume memcached is running on the local host on the default port, but this is not an ideal set up for larger sites.
 
-- 
cgit v1.2.3


From 1cb684c2ef12eea5661b17903f4986edfba0a464 Mon Sep 17 00:00:00 2001
From: Konstantin Haase <konstantin.mailinglists@googlemail.com>
Date: Tue, 4 Sep 2012 15:50:09 +0200
Subject: update caching guide: stale? can also figure out last_modified on its
 own

---
 guides/source/caching_with_rails.textile | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

(limited to 'guides/source/caching_with_rails.textile')

diff --git a/guides/source/caching_with_rails.textile b/guides/source/caching_with_rails.textile
index f6d6c8b550..9f1ac18814 100644
--- a/guides/source/caching_with_rails.textile
+++ b/guides/source/caching_with_rails.textile
@@ -439,7 +439,7 @@ class ProductsController < ApplicationController
 
     # If the request is stale according to the given timestamp and etag value
     # (i.e. it needs to be processed again) then execute this block
-    if stale?(:last_modified => @product.updated_at.utc, :etag => @product)
+    if stale?(:last_modified => @product.updated_at.utc, :etag => @product.cache_key)
       respond_to do |wants|
         # ... normal response processing
       end
@@ -453,6 +453,17 @@ class ProductsController < ApplicationController
 end
 </ruby>
 
+Instead of a options hash, you can also simply pass in a model, Rails will use the methods +updated_at+ and +cache_key+ for setting +last_modified+ and +etag+:
+
+<ruby>
+class ProductsController < ApplicationController
+  def show
+    @product = Product.find(params[:id])
+    respond_with(@product) if stale?(@product)
+  end
+end
+</ruby>
+
 If you don't have any special response processing and are using the default rendering mechanism (i.e. you're not using respond_to or calling render yourself) then you’ve got an easy helper in fresh_when:
 
 <ruby>
-- 
cgit v1.2.3


From c9d1ba41fd1195d4aaece2a4fc5c83273bd835bd Mon Sep 17 00:00:00 2001
From: schneems <richard.schneeman@gmail.com>
Date: Wed, 5 Sep 2012 15:51:20 -0700
Subject: Doc: sweepers only work on Active Record Models

In response to this rails issue: https://github.com/rails/rails/issues/3729
---
 guides/source/caching_with_rails.textile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'guides/source/caching_with_rails.textile')

diff --git a/guides/source/caching_with_rails.textile b/guides/source/caching_with_rails.textile
index 9f1ac18814..577596ac0d 100644
--- a/guides/source/caching_with_rails.textile
+++ b/guides/source/caching_with_rails.textile
@@ -173,7 +173,9 @@ expire_fragment('all_available_products')
 
 h4. Sweepers
 
-Cache sweeping is a mechanism which allows you to get around having a ton of +expire_{page,action,fragment}+ calls in your code. It does this by moving all the work required to expire cached content into an +ActionController::Caching::Sweeper+ subclass. This class is an observer and looks for changes to an object via callbacks, and when a change occurs it expires the caches associated with that object in an around or after filter.
+Cache sweeping is a mechanism which allows you to get around having a ton of +expire_{page,action,fragment}+ calls in your code. It does this by moving all the work required to expire cached content into an +ActionController::Caching::Sweeper+ subclass. This class is an observer and looks for changes to an Active Record object via callbacks, and when a change occurs it expires the caches associated with that object in an around or after filter.
+
+TIP: Sweepers rely on the use of Active Record and Active Record Observers. The object you are observing must be an Active Record model.
 
 Continuing with our Product controller example, we could rewrite it with a sweeper like this:
 
-- 
cgit v1.2.3


From 2db79dc9ea0b623c6d76b72e85f58efd63b50e08 Mon Sep 17 00:00:00 2001
From: Vijay Dev <vijaydev.cse@gmail.com>
Date: Sun, 9 Sep 2012 17:25:09 +0530
Subject: minor fixes and edits [ci skip]

---
 guides/source/caching_with_rails.textile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'guides/source/caching_with_rails.textile')

diff --git a/guides/source/caching_with_rails.textile b/guides/source/caching_with_rails.textile
index 577596ac0d..712440da32 100644
--- a/guides/source/caching_with_rails.textile
+++ b/guides/source/caching_with_rails.textile
@@ -455,7 +455,7 @@ class ProductsController < ApplicationController
 end
 </ruby>
 
-Instead of a options hash, you can also simply pass in a model, Rails will use the methods +updated_at+ and +cache_key+ for setting +last_modified+ and +etag+:
+Instead of a options hash, you can also simply pass in a model, Rails will use the +updated_at+ and +cache_key+ methods for setting +last_modified+ and +etag+:
 
 <ruby>
 class ProductsController < ApplicationController
-- 
cgit v1.2.3

