Added info about parameters passed to caches_action and removed More: blocks to clean up a little
This commit is contained in:
parent
21b80f8144
commit
b9e87f4679
@ -80,8 +80,6 @@ end
|
|||||||
If you want a more complicated expiration scheme, you can use cache sweepers
|
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.
|
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
|
h4. Action Caching
|
||||||
|
|
||||||
One of the issues with Page Caching is that you cannot use it for pages that
|
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
|
or the number of items in the cart can be left uncached. This feature is
|
||||||
available as of Rails 2.2.
|
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?
|
Finally, if you are using memcached, you can also pass +:expires_in+. In fact,
|
||||||
Description of Rake tasks to clear cached files? Show example of
|
all parameters not used by caches_action are sent to the underlying cache
|
||||||
subdomain caching? Talk about :cache_path, :if and assing blocks/Procs
|
store.
|
||||||
to expire_action?]
|
|
||||||
|
|
||||||
h4. Fragment Caching
|
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(':'))
|
expire_fragment(:key => ['all_available_products', @latest_product.created_at].join(':'))
|
||||||
</ruby>
|
</ruby>
|
||||||
|
|
||||||
[More: more examples? description of fragment keys and expiration, etc? pagination?]
|
|
||||||
|
|
||||||
h4. Sweepers
|
h4. Sweepers
|
||||||
|
|
||||||
Cache sweeping is a mechanism which allows you to get around having a ton of
|
Cache sweeping is a mechanism which allows you to get around having a ton of
|
||||||
@ -259,8 +258,6 @@ class ProductsController < ActionController
|
|||||||
end
|
end
|
||||||
</ruby>
|
</ruby>
|
||||||
|
|
||||||
[More: more examples? better sweepers?]
|
|
||||||
|
|
||||||
h4. SQL Caching
|
h4. SQL Caching
|
||||||
|
|
||||||
Query caching is a Rails feature that caches the result set returned by each
|
Query caching is a Rails feature that caches the result set returned by each
|
||||||
|
Loading…
Reference in New Issue
Block a user