diff options
author | José Valim <jose.valim@plataformatec.com.br> | 2012-08-21 12:58:25 -0700 |
---|---|---|
committer | José Valim <jose.valim@plataformatec.com.br> | 2012-08-21 12:58:25 -0700 |
commit | 6bef1469d2e43d0815b70588370470983a4320af (patch) | |
tree | 7d1f2f5cc9506507e02cc13d2b6ff7f614a8ca88 /railties/lib/rails/generators | |
parent | 11e890fef8982caa206e4fbc033f896e6ad424a1 (diff) | |
parent | da3d28ea33a7e418c99e89aa6b4028ba054f1f39 (diff) | |
download | rails-6bef1469d2e43d0815b70588370470983a4320af.tar.gz rails-6bef1469d2e43d0815b70588370470983a4320af.tar.bz2 rails-6bef1469d2e43d0815b70588370470983a4320af.zip |
Merge pull request #7225 from rails/eager_load
Improve eager load on Rails
Diffstat (limited to 'railties/lib/rails/generators')
3 files changed, 14 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt index 2016eb8b05..122e7e2b34 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt @@ -6,6 +6,9 @@ # since you don't have to restart the web server when you make code changes. config.cache_classes = false + # Do not eager load code on boot. + config.eager_load = false + # Show full error reports and disable caching. config.consider_all_requests_local = true config.action_controller.perform_caching = false diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt index 80413be0d3..a627636089 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt @@ -4,6 +4,12 @@ # Code is not reloaded between requests. config.cache_classes = true + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both thread web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + # Full error reports are disabled and caching is turned on. config.consider_all_requests_local = false config.action_controller.perform_caching = true diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt index 878deb49d7..8ab27eb6e1 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt @@ -7,6 +7,11 @@ # and recreated between test runs. Don't rely on the data there! config.cache_classes = true + # Do not eager load code on boot. This avoids loading your whole application + # just for the purpose of running a single test. If you are using a tool that + # preloads Rails for running tests, you may have to set it to true. + config.eager_load = false + # Configure static asset server for tests with Cache-Control for performance. config.serve_static_assets = true config.static_cache_control = "public, max-age=3600" |