0

I wrote a custom module for the apache http server as described in: http://httpd.apache.org/docs/2.4/developer/modguide.html

ap_rprintf(r, "Hello, world!");

I've been asked about the behavior of mod_deflate http://httpd.apache.org/docs/2.2/mod/mod_deflate.html .

Will response to the client produced by my module will be compressed by mod_deflate if the client accepts the compression with Accept-Encoding: gzip ?

If my response is already gzipped , can I prevent mod_deflate to work ?

Do you have any reference/link about this ?

Thanks.

4

1 に答える 1

2

デフォルトでは、通常の条件を満たしていれば圧縮されます。いくつかの方法でオプトアウトすることができます (以下は、煩わしさの大まかな順序です)。

  • リクエストごとの no-gzip 環境変数を設定します (r->subprocess_env)
  • mod_deflate 出力フィルターを削除します (mod_proxy_wstunnel.c にフィルターを移動する例があります)。
  • 応答を書き込む前に、accept-encoding ヘッダーの設定を解除してください
  • Content-Encoding: gzip 応答ヘッダーを設定する

唯一のリファレンスは mod_deflate.c + 出力フィルタの基本です。

于 2014-06-30T10:18:01.143 に答える