This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Languages » Ruby
Bookmark "Caching in Rails application " Watch "Caching in Rails application " New topic
Author

Caching in Rails application

Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8903

Is caching supported in Rails to improve application performace ?


Groovy
Justin Gehtland
author
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: 8903

Thank you Justin. Caching in Rails looks really
 
jQuery in Action, 2nd edition
 
subject: Caching in Rails application
 
Similar Threads
What does plugin exactly means
Which is the hottest Java Technolgy?
website building?
Connecting different database to a single application
Clustering ruby applications