From b9e87f46791d81083c8d44890cd50a03c1c0b7fa Mon Sep 17 00:00:00 2001 From: Aditya Chadha Date: Sun, 22 Feb 2009 18:45:17 -0500 Subject: Added info about parameters passed to caches_action and removed More: blocks to clean up a little --- railties/guides/source/caching_with_rails.textile | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'railties') 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(':')) -[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 -[More: more examples? better sweepers?] - h4. SQL Caching Query caching is a Rails feature that caches the result set returned by each -- cgit v1.2.3