On 25/04/2012 17:35, Christopher Faulet wrote:
> Hi all,
> I've just pushed to github a new feature to allow configuration of the
> deflate compression behaviour per vhost.
> By adding "<deflate> ... </deflate>" structure in vhosts configuration,
> it is possible to configure how deflate compression will be applied and
> when it will come into effect. Now we can:
> * define the smallest response size that will be compressed
> * define the compression level to be used
> * specify the zlib compression window size
> * specify how much memory should be allocated for the internal
> compression state
> * choose the strategy used to tune the compression algorithm
> All these parameters are used when a zlib stream is initialized for
> It is also possible to define all compressible mime types. Here is an
> <server localhost>
> deflate = true
> min_compress_size = 4096
> compression_level = best_compression
> mime_types = defaults, image/*
> mime_types = application/xml, application/xhtml+xml,
> mem_level = 9
> strategy = default
> window_size = 15
There is a new parameter in deflate options: use_gzip_static.
By setting it to true, Yaws will try to serve precompressed versions of
static files. It will look for precompressed files in the same location
as original files that end in ".gz". Only files that do not fit in the
cache are concerned.
This feature is inspired by a Nginx module:
Thanks to Tuncer for this good idea.