Download the PHP package christoph-kluge/reactphp-http-response-compression-middleware without Composer
On this page you can find all versions of the php package christoph-kluge/reactphp-http-response-compression-middleware. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download christoph-kluge/reactphp-http-response-compression-middleware
More information about christoph-kluge/reactphp-http-response-compression-middleware
Files in christoph-kluge/reactphp-http-response-compression-middleware
Package reactphp-http-response-compression-middleware
Short Description A response compression middleware for the ReactPHP HTTP-Server
License MIT
Informations about the package reactphp-http-response-compression-middleware
ReactPHP Response Compression Middleware
Install
To install via Composer, use the command below, it will automatically detect the latest version and bind it with ^
.
This middleware will detect if the request is compressible and will compress the response body and add relevant headers to it. Heavy lifting is done by clue/php-zlib-react, thanks!
Usage
Response-detection for compressible mime/content-types
Default detection
The default handlers will use by default the DefaultRegexDetecor
to identify compressible Content-Types by a set of regular expressions. Those regular expressions are:
Available Detectors
There are currently the following available detectors:
ArrayDetector
: Which will accept an whitelist of mime-types to check againstRegexDetecor
: Which will accept an whitelist of regular expressions to check against
Want to implement custom detectors?
If you would like to add a custom detection for the response mime type then you can simply pass an object as first parameter which implements the MimeDetectorInterface
.
License
The MIT License (MIT)
Copyright (c) 2017 Christoph Kluge
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
All versions of reactphp-http-response-compression-middleware with dependencies
psr/http-message Version ^1.0
react/promise Version ^2.5
clue/zlib-react Version ^0.2