Class | Rack::Deflater |
In: |
lib/rack/deflater.rb
|
Parent: | Object |
This middleware enables compression of http responses.
Currently supported compression algorithms:
* gzip * deflate * identity (no transformation)
The middleware automatically detects when compression is supported and allowed. For example no transformation is made when a cache directive of ‘no-transform’ is present, or when the response status code is one that doesn‘t allow an entity body.
Creates Rack::Deflater middleware.
e.g use Rack::Deflater, :if => lambda { |env, status, headers, body| body.length > 512 }
‘include’ - a list of content types that should be compressed