diff options
| author | teddywing | 2018-04-24 17:11:40 +0200 |
|---|---|---|
| committer | GitHub | 2018-04-24 17:11:40 +0200 |
| commit | 32c47f4d0ce0c6ed0f41359ed15178da18b5f5d9 (patch) | |
| tree | 854bd31986f01efecc8582f9f2466f46e5f027df /config | |
| parent | eb51cf0aa62a96c552c1a32778aa84e64df458a6 (diff) | |
| parent | 513c252fec68c0073e537d1952d90394ec8c401e (diff) | |
| download | chouette-core-32c47f4d0ce0c6ed0f41359ed15178da18b5f5d9.tar.bz2 | |
Merge pull request #494 from af83/5896-add-cache-headers
5896 Move our custom middleware up in the stack
Diffstat (limited to 'config')
| -rw-r--r-- | config/environments/development.rb | 4 | ||||
| -rw-r--r-- | config/environments/production.rb | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/config/environments/development.rb b/config/environments/development.rb index 7bd049979..d08077769 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -96,9 +96,11 @@ Rails.application.configure do config.i18n.available_locales = [:fr, :en] + config.serve_static_files = true + config.middleware.insert_after(ActionDispatch::Static, Rack::LiveReload) if ENV['LIVERELOAD'] config.middleware.use I18n::JS::Middleware - config.middleware.use CacheSettings, { + config.middleware.insert_before ActionDispatch::Static, CacheSettings, { /\/assets\/.*/ => { cache_control: "max-age=86400, public", expires: 86400 diff --git a/config/environments/production.rb b/config/environments/production.rb index eb44e1ab1..89b74154f 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -138,7 +138,7 @@ Rails.application.configure do config.iev_url = ENV.fetch('IEV_URL',"http://iev:8080") config.rails_host = ENV.fetch('RAILS_HOST','http://front:3000') - config.middleware.use CacheSettings, { + config.middleware.insert_before ActionDispatch::Static, CacheSettings, { /\/assets\/.*/ => { cache_control: "max-age=#{1.year.to_i}, public", expires: 1.year.to_i |
