Is your Rails dev. environment slow?
Read if you use the asset pipeline
The reasons for your development environment to be slow could vary a lot, however, I'd like to share something that happened to us and I hope it works for you too.
Problem
Our Rails app was serving pages fast enough ~1-1.5 seconds, but the page would render after 15 seconds.
The "problem" was on the browser. Rails by default sets the config.assets.debug
flag as true for development. This will serve your javascripts and css separately. The browser was literally choking with more than 150 connections trying to retrieve them.
Solution
- Go to
config/environments/development.rb
- Use this configuration:
config.assets.debug = false
Cons
Your Javascripts and CSS will be on 1 file each. It's supposed to make it harder to debug.
Pros
Speed.
Written by Alan Andrade
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#