diff options
author | Nathan Long <him@nathanmlong.com> | 2016-08-12 15:09:47 -0400 |
---|---|---|
committer | Nathan Long <him@nathanmlong.com> | 2016-08-12 15:09:47 -0400 |
commit | 33f116f22cd46c26ecc60e7f9f9d2bd0691b9fbb (patch) | |
tree | 30488f8d60a06989ef8f402ba26b73e4d8c18e62 | |
parent | dd5c0696d87d82ae118d74984dbfd7569cd4e9d8 (diff) | |
download | rails-33f116f22cd46c26ecc60e7f9f9d2bd0691b9fbb.tar.gz rails-33f116f22cd46c26ecc60e7f9f9d2bd0691b9fbb.tar.bz2 rails-33f116f22cd46c26ecc60e7f9f9d2bd0691b9fbb.zip |
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. |