Skip to content
This repository has been archived by the owner on Mar 23, 2022. It is now read-only.

Configuration of gzip compression level #81

Open
cdanger opened this issue Mar 1, 2015 · 2 comments
Open

Configuration of gzip compression level #81

cdanger opened this issue Mar 1, 2015 · 2 comments

Comments

@cdanger
Copy link

cdanger commented Mar 1, 2015

Hello,
is there a way to configure gzip compression level? When using true</gzip with compress goal.
Or at least allow to use the max level (lowest speed).
For instance, the linux gzip command supports 9 levels (9 being the best compression level but slowest compression method).

Thanks.

@davidB
Copy link
Owner

davidB commented Mar 4, 2015

Today, there is no way to configure it.
The plugin use java GZIPOutputStream, if you find a way to set the compression (reliable), tell me or made a Pull Request.

@cdanger
Copy link
Author

cdanger commented Mar 10, 2015

Yes, there is some help here:
https://weblogs.java.net/blog/2003/12/26/achieving-better-compression-deflater
In short, instead of:

GZIPOutputStream gzipout = new GZIPOutputStream(bos);

use

OutputStream gzipout = new GZIPOutputStream(bos){{def.setLevel(Deflater.BEST_COMPRESSION);}};

I have not tested it myself, but it is used by others.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants