fix brotli origin

This commit is contained in:
Sam Saffron 2017-02-23 18:26:40 -05:00
parent ef08462b33
commit 3754b038e8
1 changed files with 4 additions and 3 deletions

View File

@ -147,12 +147,11 @@ class StaticController < ApplicationController
return
end
response.headers["Expires"] = 1.year.from_now.httpdate
response.headers["Cache-Control"] = 'max-age=31557600, public'
response.headers["Content-Encoding"] = 'br'
# disable NGINX mucking with transfer
request.env['sendfile.type'] = ''
immutable_for 1.year
send_file(path, opts)
end
@ -178,6 +177,8 @@ class StaticController < ApplicationController
opts = { disposition: nil }
opts[:type] = "application/javascript" if path =~ /\.js$/
immutable_for(1.year)
# we must disable acceleration otherwise NGINX strips
# access control headers
request.env['sendfile.type'] = ''