HtmlMinifyMiddleware
final class HtmlMinifyMiddleware implements MiddlewareInterface (View source)
Minifies non-empty HTML responses when enabled while preserving response immutability.
Methods
Connects the HTML transformer with its resolved runtime switch.
process(ServerRequestInterface $request, RequestHandlerInterface $handler)
Replaces eligible response bodies and recalculates their Content-Length header.
ResponseInterface
Details
__construct
__construct(HtmlMinifier $minifier, HtmlMinifyConfig $config)
Connects the HTML transformer with its resolved runtime switch.
process
ResponseInterface
process(ServerRequestInterface $request, RequestHandlerInterface $handler)
Replaces eligible response bodies and recalculates their Content-Length header.