2

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.

Kmaschta
  • 2,369
  • 1
  • 18
  • 36
Rubyst
  • 21
  • 2

1 Answers1

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