Rails 3.1 is very slow in development-mode because of assets, what to do?

后端 未结 5 1183
再見小時候
再見小時候 2020-12-13 00:11

After I added Sprockets, Rails is loading very slow in development mode, what should I do to speed it up?

5条回答
  •  一整个雨季
    2020-12-13 00:59

    Take a look at https://github.com/wavii/rails-dev-tweaks.

    Rails is running all of the to_prepare hooks on every Sprockets asset request in development mode. This includes things like auto-(re)loading your code, and various gems sneak work in there too.

    rails-dev-tweaks disables to_prepare & reloading on any asset request (and a few others - read the first part of its README). Speeds up your dev environment by a huge amount for any decently sized project. It's also configurable to do this for any additional requests you like

提交回复
热议问题