rack/rack — pull request #457 by jakubpawlowicz (2012-11-14 21:48:05+00:00)
Title: Configuration options for Rack::Deflate

Rack::Deflater currently does not support any configuration options which makes it cumbersome to control.

This pull request adds support for the following options:
* __min_content_length__ - minimum content length (in bytes) to trigger deflating;
* __exclude__ - a regular expression for excluding certain URLs from being processed;
* __skip_if__ - a lambda for choosing whether to deflate based on current execution scope (request, status, body, or headers)

Examples:
```use Rack::Deflater, { min_content_length: 1000 }```
```use Rack::Deflater, { exclude: /\.pdf$/ }```
```use Rack::Deflater, { skip_if: lambda { |env, status, headers, body| status != 200 }```