httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua Slive" <>
Subject Re: [users@httpd] Re: Preventing mod_deflate dechunking of dynamic content
Date Tue, 19 Sep 2006 17:38:00 GMT
On 9/19/06, Manuel Lemos <> wrote:
> What I really need is to be able to force chunked response only on
> specific requests to PHP scripts.
> If it is not possible or desirable to serve compressed chunked
> responses, then what I need to be able to force uncompressed chunked
> responses on specific requests.
> I know how to disable mod_gzip/mod_deflate for specific URI. However,
> that is not what I want because I need to serve chunked responses or not
> for requests to the same URI, depending on conditions evaluated
> dynamically by the PHP scripts.
> So, my doubt is: how can I configure Apache to return a response that
> may trigger chunking/compression or not that mod_gzip/mod_deflate performs ?
> I though of returning a custom header like "x-dechunk: no" from the PHP
> script response. But how can I configure Apache with
> mod_gzip/mod_deflate to not compress responses when that header is
> returned by a PHP script?

It's easy enough to turn on or off deflate per-request using the
no-gzip environment variable.  But unfortunately, I don't think there
is any way to set an environment variable based on a response header.
This is because env variables need to be set early in order to be
useful for content handlers.  So they are set too early to look at
response headers.

One option would be to have your php script do an internal redirect to
a non-deflated page.  Another option would be to deflate everything,
but pad small response segments up to DeflateBufferSize.  (The padding
should be mostly compressed away anyway.)


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message