paolochiodi / htmlcompressor

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

Doesn't work together with Rack::Deflater #19

Closed dyatlov closed 6 years ago

dyatlov commented 9 years ago

When I use in config both HtmlCompressor and Rack::Deflater - I get data stream error:

config.middleware.use HtmlCompressor::Rack
config.middleware.use Rack::Deflater
paolochiodi commented 9 years ago

Hi @dyatlov thank you for reporting and sorry for the late response. This is a situation I never found myself in, but I'll try to see if I can reproduce the error and how to fix. Unfortunately, as you may guess, I'm not spending much time on htmlcompressor these days so it could take a while before I can fix it, but if you can provide a pull-request I'd be happy to merge it.

BrokenChair commented 9 years ago

It seems to work if I reverse the order

config.middleware.use Rack::Deflater config.middleware.use HtmlCompressor::Rack

Is that correct though? Can the compression work after the content has been deflated?

dyatlov commented 9 years ago

of course CAN'T :)

BrokenChair commented 9 years ago

My browser shows that it is gzipped and the content is definitely compressed. Google Pagespeed confirms that the content is minified and gzipped.

Running rake middleware definitely shows that Deflater is above HtmlCompressor. What sorcery is this?

dyatlov commented 9 years ago

heh.. okay

paolochiodi commented 6 years ago

Old issue