jstuckey / gulp-gzip

Gzip plugin for gulp.
MIT License
175 stars 17 forks source link

[Question] Why are files not compressed as much as with other gzip tools? #34

Closed justinhelmer closed 5 years ago

justinhelmer commented 5 years ago

As an example, here are a couple of our files compressed using gulp-gzip (all default options):

Screen Shot 2019-03-28 at 1 54 03 PM

Also tried explicitly setting { gzipOptions: { level: 9 } }, but it had no effect. However changing the level to a lower number increased the size, leading me to the conclusion that level 9 is the default compression level.

And here are those same files, compressed using the command-line gzip utility (all default options):

Screen Shot 2019-03-28 at 1 54 08 PM

We get the same results (the smaller sizes i.e. the second screenshot) when compressing server-side with the compression middleware.

Since they are all using zlib, I would expect the same results across the board. But as you can see, the file sizes are nearly double with gulp-gzip. Any thoughts?

justinhelmer commented 5 years ago

my issue was with what was getting piped into the compression.