I want to reduce my application load time, I am using Comfy ComfortableMexicanSofa cms with rails 4.2, I want to cache whole page so that when a user hit a URL from browser my application does not load cms page content from db just load that page from cache.
Asked
Active
Viewed 180 times
2
-
I have deployed my code on heroku – Rubyst Oct 24 '17 at 09:57
1 Answers
1
You gotta overwrite this controller: https://github.com/comfy/comfortable-mexican-sofa/blob/master/app/controllers/comfy/cms/content_controller.rb
Just copy it into your own app/controllers/comfy/cms folder. Then wrap that render call with cache @cms_page do
. That should reduce DB access a bit. The reason why it's not there by default is because page content may include partials/helpers that are dynamic (like currently logged-in user).
If you want to have full page caching - look into Apache/Nginx caching. Rails doesn't do page caching anymore. Also Amazon's CloudFront.

Grocery
- 2,244
- 16
- 26