paolochiodi / htmlcompressor

A work in progress port of google's htmlcompressor.jar
Other
152 stars 26 forks source link

How do I disable compression for specific pages / view, etc? #20

Closed ndvbd closed 6 years ago

paolochiodi commented 9 years ago

At the moment the rack middleware is compressing all the responses with a Content Type header that matches "html".

Unfortunately I don't plan to work on htmlcompressor on the next days (maybe weeks too), so you may want to build your own middleware. For guidance see the code for the included middleware (is quite simple): https://github.com/paolochiodi/htmlcompressor/blob/master/lib/htmlcompressor/rack.rb

ndvbd commented 9 years ago

I tried to mount it likes this (routes.rb)

mount HtmlCompressor::Rack.new(Rails.application) => "/test"

But it doesn't work. Do you think it's possible?

marvindanig commented 9 years ago

Guess, I'm gonna need this too. Was there any movement on this? Or if I can dig in, where to look.

ndvbd commented 8 years ago

Any progress here?

ndvbd commented 8 years ago

Okay, I did it myself - see the pull request. Works great! @marvindanig -> you can take it from there

marvindanig commented 8 years ago

:+1: will give it a look in a bit.

marvindanig commented 8 years ago

Looks good, thanks @nadavb!

I hope @paolochiodi will merge this pull request (and other two) into the master soon.

paolochiodi commented 6 years ago

Old issue