简体   繁体   English

如何在puma服务器中启用gzip

[英]How enable gzip in puma server

Please help me. 请帮我。 Can the puma server use gzip compression? 美洲狮服务器可以使用gzip压缩吗? If yes, how can i configure it? 如果是,我该如何配置它?

I try to use config/puma.rb file 我尝试使用config / puma.rb文件

something like: 就像是:

gzip on;

but nothing helped. 但没有任何帮助。

I use: rails 4.0.0, jruby, puma. 我用的是:rails 4.0.0,jruby,puma。

I think that you should use Nginx or Apache for gzip compression. 我认为你应该使用Nginx或Apache进行gzip压缩。 You can try this link 你可以试试这个链接

Puma will only serve the application. Puma只会提供应用程序。 Compression, expiration time and other stuff related to the application files are reverse proxy stuff. 压缩,到期时间和与应用程序文件相关的其他内容是反向代理的东西。

rack deflater will work with puma 机架deflater将与美洲狮

add use Rack::Deflater to your config.ru file 添加use Rack::Deflater到您的config.ru文件

Take a look at this question/answer: Where to insert Rack::Deflater in the rack? 看看这个问题/答案: 在机架中插入Rack :: Deflater的位置?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM