Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How enable gzip in puma server

Please help me. Can the puma server use gzip compression? If yes, how can i configure it?

I try to use config/puma.rb file

something like:

gzip on;

but nothing helped.

I use: rails 4.0.0, jruby, puma.

like image 988
user2688740 Avatar asked Nov 01 '25 23:11

user2688740


2 Answers

rack deflater will work with puma

add use Rack::Deflater to your config.ru file

Take a look at this question/answer: Where to insert Rack::Deflater in the rack?

like image 151
lardcanoe Avatar answered Nov 04 '25 18:11

lardcanoe


I think that you should use Nginx or Apache for gzip compression. You can try this link

Puma will only serve the application. Compression, expiration time and other stuff related to the application files are reverse proxy stuff.

like image 38
Rodrigo Oliveira Avatar answered Nov 04 '25 18:11

Rodrigo Oliveira