Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated documentation to fix a few mistakes, clear up a few points, a…
…nd added compression guide
- Loading branch information
Showing
4 changed files
with
55 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
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: <br> | ||
1. Add `#!cpp #define CROW_ENABLE_COMPRESSION` to the top of your main source file. | ||
2. Call `#!cpp use_compression(crow::compression::algorithm)` on your crow app. | ||
3. When compiling your application, make sure that ZLIB is included as a dependency. Either through `-lz` argument or `find_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`.<br> | ||
And now your HTTP responses will be compressed. | ||
|
||
## Websocket Compression | ||
Crow currently does not support Websocket compression.<br> | ||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters