summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_http_compression.h
diff options
context:
space:
mode:
authorAndrew Clayton <a.clayton@nginx.com>2024-10-10 17:06:36 +0100
committerAndrew Clayton <a.clayton@nginx.com>2025-04-21 15:48:12 +0100
commit4b86ad6d473f24b4ed8ad846a65e09376e064308 (patch)
tree2c3e5037dc3bbac43dd29fbf68eb38df2c6ef903 /src/nxt_http_compression.h
parentadaecb6f9efcf435e09c57ecb095f8109d17a817 (diff)
downloadunit-4b86ad6d473f24b4ed8ad846a65e09376e064308.tar.gz
unit-4b86ad6d473f24b4ed8ad846a65e09376e064308.tar.bz2
http: Compress application responses
This adds initial support for compressing application responses. A couple of things to note 1) Compressed responses are sent 'chunked' as we don't know beforehand how large the compressed response will be. 2) We only compress responses where we know the Content-Length as we need to check with the 'min_length' config parameter. It's also currently how we track when we need to close the compression stream off. Co-authored-by: Alejandro Colomar <alx@kernel.org> Signed-off-by: Alejandro Colomar <alx@kernel.org> Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
Diffstat (limited to 'src/nxt_http_compression.h')
-rw-r--r--src/nxt_http_compression.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nxt_http_compression.h b/src/nxt_http_compression.h
index 9f3567c1..f178e984 100644
--- a/src/nxt_http_compression.h
+++ b/src/nxt_http_compression.h
@@ -90,6 +90,8 @@ extern const nxt_http_comp_operations_t nxt_http_comp_brotli_ops;
#endif
+extern nxt_int_t nxt_http_comp_compress_app_response(nxt_task_t *task,
+ nxt_http_request_t *r, nxt_buf_t **b);
extern nxt_int_t nxt_http_comp_compress_static_response(nxt_task_t *task,
nxt_file_t **f, nxt_file_info_t *fi, size_t static_buf_len,
size_t *out_total);