Wednesday, March 02, 2016

Compress Html to Improve Rails 4.2.5 App Performance

1. Add htmlcompressor gem to Gemfile.

group :production do
  gem 'htmlcompressor'
end

Run bundle install.

2. In production.rb:

  config.middleware.use HtmlCompressor::Rack

3. Deploy and enjoy the speed.


GTmetrix.com test score for html compression went up. But the performance went down. The page load time went up to 2.1 seconds from 1.7 seconds.

No comments:

Post a Comment