diff options
| author | Zog | 2018-04-17 16:53:54 +0200 |
|---|---|---|
| committer | Zog | 2018-04-17 16:53:54 +0200 |
| commit | 513c252fec68c0073e537d1952d90394ec8c401e (patch) | |
| tree | 1a06290d16710e1789a72239f002a3dfdd281b34 /config | |
| parent | ac9495472164136dd4604f89c7bebaee3cecdd0c (diff) | |
| download | chouette-core-513c252fec68c0073e537d1952d90394ec8c401e.tar.bz2 | |
Refs #5896; Move our custom middleware up in the stack
This will ensure it is used even for static files
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 |
