mirror of
https://github.com/CrowCpp/Crow.git
synced 2024-06-07 21:10:44 +00:00
8617aaf6a9
- Added landing page - Changed theme completely - Added donate button - Added social media picture and description (OpenGraph) - Added version tag to any feature introduced after v0.1
1.0 KiB
1.0 KiB
Introduced in: v0.3
Crow supports Zlib compression using Gzip or Deflate algorithms.
HTTP Compression
HTTP compression is by default disabled in crow. Do the following to enable it:
- Add
#!cpp #define CROW_ENABLE_COMPRESSION
to the top of your main source file. - Call
#!cpp use_compression(crow::compression::algorithm)
on your crow app. - When compiling your application, make sure that ZLIB is included as a dependency. Either through
-lz
argument orfind_package(ZLIB)
in CMake.
!!! note
step 3 is not needed for MSVC since `vcpckg.json` already includes zlib as a dependency by default
For the compression algorim you can use crow::compression::algorithm::DEFLATE
or crow::compression::algorithm::GZIP
.
And now your HTTP responses will be compressed.
Websocket Compression
Crow currently does not support Websocket compression.
Feel free to discuss the subject with us on Github if you're feeling adventurous and want to try to implement it. We appreciate all the help.