diff options
author | Vipul A M <vipulnsward@gmail.com> | 2016-01-19 22:00:42 +0530 |
---|---|---|
committer | Vipul A M <vipulnsward@gmail.com> | 2016-01-19 23:48:59 +0530 |
commit | 067c52f608568e35181830a5c1016e382650e655 (patch) | |
tree | f78376e91750461073c49328f38883bf951a9df2 /actionpack/lib/action_dispatch/middleware | |
parent | 3af3c19fd06feb8c705289c16b625cab3378c7e8 (diff) | |
download | rails-067c52f608568e35181830a5c1016e382650e655.tar.gz rails-067c52f608568e35181830a5c1016e382650e655.tar.bz2 rails-067c52f608568e35181830a5c1016e382650e655.zip |
Its ideal to set Vary: Accept-Encoding, irrespective of whether gzipped version exists or not. This is helpful for CDN's to later distinguish assets, based on previous, current copies and introduced gzip version if any.
For ref: https://www.fastly.com/blog/best-practices-for-using-the-vary-header
This change sets `Vary` header always, to be on safer side
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/static.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/static.rb b/actionpack/lib/action_dispatch/middleware/static.rb index 41c220236a..3eab3795a0 100644 --- a/actionpack/lib/action_dispatch/middleware/static.rb +++ b/actionpack/lib/action_dispatch/middleware/static.rb @@ -65,7 +65,7 @@ module ActionDispatch status, headers, body = @file_server.call(request.env) end - headers['Vary'] = 'Accept-Encoding' if gzip_path + headers['Vary'] = 'Accept-Encoding' return [status, headers, body] ensure |