Plack::Middleware::Zstandard - Compress response body with Zstandard
version 0.02
use Plack::Builder; my $app = sub { return [ 200, [ 'Content-Type' => 'text/plain' ], [ "Hello World!\n" ], ]; }; builder { enable 'Zstandard'; $app; };
This middleware encodes the body of the response using Zstandard, based on the Accept-Encoding
request header.
Compression level. Should be an integer from 1 to 22. If not provided, then the default will be chosen by Compress::Stream::Zstd.
If set to true (the default), then the response will vary on Content-Encoding
. This is usually what you want, but if you have another middleware or application that is already vary'ing on that header, you may want to set this to false.
Graham Ollis <plicease@cpan.org>
This software is copyright (c) 2024 by Graham Ollis.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.