wood burning stoves 2.0
The moose likes Ruby and the fly likes Caching in Rails application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Ruby
Bookmark "Caching in Rails application " Watch "Caching in Rails application " New topic

Caching in Rails application

Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8927

Is caching supported in Rails to improve application performace ?

Justin Gehtland
Ranch Hand

Joined: Jan 30, 2007
Posts: 31
Yes. Rails supports caching at several levesls:

1) full page output. When templates are rendered, they can be stored in the /public folder automatically as HTML for future rendering. This can be scheduled to timeout at certain intervals using a filter.

2) partial page output. The results of rendering partials can be cached for future inclusion into another template.

3) action caching. The results of running a controller action can be cached for use in another template.

I actually find the caching strategies in Rails easier to manage than in other web frameworks.

The only caching that Rails does NOT support natively is object caching. ActiveRecord does not have a native second-level cache for the objects loaded from the database. You can use the optional acts_as_cached plugin, which uses memcached as its storage device, which is localized second-level caching. As far as I know, there is no native, clustered second-level cache for data objects.
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8927

Thank you Justin. Caching in Rails looks really
I agree. Here's the link: http://aspose.com/file-tools
subject: Caching in Rails application
It's not a secret anymore!