diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2017-08-11 17:54:04 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-11 17:54:04 -0400 |
commit | b9e0b4f19940fdd7105db3dffc507cbd89ac3705 (patch) | |
tree | 3f24b1728f9bf86c029a7897c91e1fa36d43204d /actionpack/lib/action_controller | |
parent | c8bbeb31dd402bb4a907a9b8ef021bf8e1afe2aa (diff) | |
parent | 0668c22a41e4c88ccb7600fc5b4bfb1a5b76e45d (diff) | |
download | rails-b9e0b4f19940fdd7105db3dffc507cbd89ac3705.tar.gz rails-b9e0b4f19940fdd7105db3dffc507cbd89ac3705.tar.bz2 rails-b9e0b4f19940fdd7105db3dffc507cbd89ac3705.zip |
Merge pull request #29559 from kirs/eager-load-controller-actions
Eager load controller actions to reduce response time of the first request
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/railtie.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/railtie.rb b/actionpack/lib/action_controller/railtie.rb index 7dea22931c..cc02c9a53a 100644 --- a/actionpack/lib/action_controller/railtie.rb +++ b/actionpack/lib/action_controller/railtie.rb @@ -79,5 +79,11 @@ module ActionController end end end + + initializer "action_controller.eager_load_actions" do + ActiveSupport.on_load(:after_initialize) do + ActionController::Metal.descendants.each(&:action_methods) if config.eager_load + end + end end end |