Gzip
in package
implements
MiddlewareInterface
Filter to gzip content before being served
Tags
Table of Contents
Interfaces
- MiddlewareInterface
Properties
- $streamFactory : StreamFactoryInterface
Methods
- __construct() : mixed
- process() : ResponseInterface
- Compress output stream and set header
- _byteCount() : int
- If mbstring is set to overload str* function then we could be counting multi-byte chars as single bytes so we need to treat the string like its 8-bit encoded to get an accurate byte count.
Properties
$streamFactory
private
StreamFactoryInterface
$streamFactory
Methods
__construct()
public
__construct(StreamFactoryInterface $streamFactory) : mixed
Parameters
- $streamFactory : StreamFactoryInterface
process()
Compress output stream and set header
public
process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
Parameters
- $request : ServerRequestInterface
- $handler : RequestHandlerInterface
Return values
ResponseInterface_byteCount()
If mbstring is set to overload str* function then we could be counting multi-byte chars as single bytes so we need to treat the string like its 8-bit encoded to get an accurate byte count.
protected
_byteCount(string $string) : int
Parameters
- $string : string