diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2016-08-12 20:30:25 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-12 20:30:25 -0300 |
commit | b7afe9a078342885050a7d078439256359d0eef7 (patch) | |
tree | 5ded41a7991a23aa7ff1f4cb763eb73da667ec6b | |
parent | cd8f5913e8d0c53da227471fe88bb2294f354faf (diff) | |
parent | 33f116f22cd46c26ecc60e7f9f9d2bd0691b9fbb (diff) | |
download | rails-b7afe9a078342885050a7d078439256359d0eef7.tar.gz rails-b7afe9a078342885050a7d078439256359d0eef7.tar.bz2 rails-b7afe9a078342885050a7d078439256359d0eef7.zip |
Merge pull request #26143 from nathanl/self-explanatory-cache-durations
Make cache max-age durations self-explanatory
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt | 2 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt | 2 |
2 files changed, 2 insertions, 2 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 f3ccf95045..511b4a82eb 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 @@ -18,7 +18,7 @@ Rails.application.configure do config.cache_store = :memory_store config.public_file_server.headers = { - 'Cache-Control' => 'public, max-age=172800' + 'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}" } else config.action_controller.perform_caching = false 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 42fee3b036..56416b3075 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 @@ -15,7 +15,7 @@ Rails.application.configure do # Configure public file server for tests with Cache-Control for performance. config.public_file_server.enabled = true config.public_file_server.headers = { - 'Cache-Control' => 'public, max-age=3600' + 'Cache-Control' => "public, max-age=#{1.hour.seconds.to_i}" } # Show full error reports and disable caching. |