aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorAditya Chadha <aditya@sublucid.com>2009-02-22 18:45:17 -0500
committerAditya Chadha <aditya@sublucid.com>2009-02-22 18:45:17 -0500
commitb9e87f46791d81083c8d44890cd50a03c1c0b7fa (patch)
tree2dfed493463c04d3d3ea34e7eb9d8e0b5b1e4da9 /railties
parent21b80f8144f8f05a105b2989c79d3ed2f2d0d4cd (diff)
downloadrails-b9e87f46791d81083c8d44890cd50a03c1c0b7fa.tar.gz
rails-b9e87f46791d81083c8d44890cd50a03c1c0b7fa.tar.bz2
rails-b9e87f46791d81083c8d44890cd50a03c1c0b7fa.zip
Added info about parameters passed to caches_action and removed More: blocks to clean up a little
Diffstat (limited to 'railties')
-rw-r--r--railties/guides/source/caching_with_rails.textile17
1 files changed, 7 insertions, 10 deletions
diff --git a/railties/guides/source/caching_with_rails.textile b/railties/guides/source/caching_with_rails.textile
index f4fb8ec348..d77f48929d 100644
--- a/railties/guides/source/caching_with_rails.textile
+++ b/railties/guides/source/caching_with_rails.textile
@@ -80,8 +80,6 @@ end
If you want a more complicated expiration scheme, you can use cache sweepers
to expire cached objects when things change. This is covered in the section on Sweepers.
-[More: caching paginated results? more examples? Walk-through of page caching?]
-
h4. Action Caching
One of the issues with Page Caching is that you cannot use it for pages that
@@ -122,11 +120,14 @@ layout so that dynamic information in the layout such as logged in user info
or the number of items in the cart can be left uncached. This feature is
available as of Rails 2.2.
+You can modify the default action cache path by passing a +:cache_path+ option.
+This will be passed directly to ActionCachePath.path_for. This is handy for
+actions with multiple possible routes that should be cached differently. If
+a block is given, it is called with the current controller instance.
-[More: more examples? Walk-through of Action Caching from request to response?
- Description of Rake tasks to clear cached files? Show example of
- subdomain caching? Talk about :cache_path, :if and assing blocks/Procs
- to expire_action?]
+Finally, if you are using memcached, you can also pass +:expires_in+. In fact,
+all parameters not used by caches_action are sent to the underlying cache
+store.
h4. Fragment Caching
@@ -190,8 +191,6 @@ the key and can be expired the same way:
expire_fragment(:key => ['all_available_products', @latest_product.created_at].join(':'))
</ruby>
-[More: more examples? description of fragment keys and expiration, etc? pagination?]
-
h4. Sweepers
Cache sweeping is a mechanism which allows you to get around having a ton of
@@ -259,8 +258,6 @@ class ProductsController < ActionController
end
</ruby>
-[More: more examples? better sweepers?]
-
h4. SQL Caching
Query caching is a Rails feature that caches the result set returned by each