遇到一个很奇怪的问题,希望各位大牛帮解惑,非常感谢
我的 Rails 版本比较低 3.2,我想把一些静态 JS 通过 ZIP 进行压缩 application.rb 中配置如下
config.middleware.insert_before ActionDispatch::Static, Rack::Deflater
在 development 环境下 JS 可以 zip 压缩
Cache-Control:no-store, must-revalidate, private, max-age=0
Connection:Keep-Alive
Content-Encoding:gzip
Content-Length:286241
Content-Type:application/javascript
Date:Wed, 23 May 2018 07:34:38 GMT
Last-Modified:Tue, 22 May 2018 01:22:34 GMT
Server:WEBrick/1.3.1 (Ruby/1.9.3/2013-11-22)
Set-Cookie:__profilin=p%3Dt; path=/
Set-Cookie:__profilin=p%3Dt; path=/
Set-Cookie:__profilin=p%3Dt; path=/
Vary:Accept-Encoding
但是在 production 环境下始终没有效果:
Accept-Ranges:bytes
Connection:keep-alive
Content-Length:1006540
Content-Type:application/javascript; charset=utf-8
Date:Wed, 23 May 2018 07:37:28 GMT
ETag:"5afec9cd-f5bcc"
Last-Modified:Fri, 18 May 2018 12:40:45 GMT
Server:nginx/1.10.1
请问有好的解决方法吗?非常感谢!