Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

Caching in Rails application

 
Ranch Hand
Posts: 8943
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is caching supported in Rails to improve application performace ?
 
author
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8943
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Justin. Caching in Rails looks really
 
So it takes a day for light to pass through this glass? So this was yesterday's tiny ad?
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic