httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Johnson <>
Subject Re: [users@httpd] gzipping via mod_deflate, the DeflateBufferSize, the Content-Length header, and download progress in Web browsers
Date Wed, 26 Sep 2012 15:34:23 GMT

On 9/12/2012 1:16 PM, Ben Johnson wrote:
> Would it be better to disable GZIP compression for all URLs within the
> /download/ (for example) directory?
> Or perhaps for certain file-types? Because I tried that with the
> following, but it seems not to have any effect (I believe this example
> to be directly from the Apache documentation, with a few additional
> extensions added):
> <Location />
> SetOutputFilter DEFLATE
> # Don't compress images (or other files that are already compressed)
> SetEnvIfNoCase Request_URI \
> \.(?:gif|jpe?g|png|zip|7z|rar|sit?x|mp3|flac|ogg|pdf)$ no-gzip dont-vary
> # Make sure proxies don't deliver the wrong content
> Header append Vary User-Agent env=!dont-vary
> </Location>
> The URLs in question take the following format:
> https://localhost/public/download/
> Also, I am setting the Content-Type header appropriately, e.g., to
> "application/zip", given the above URL.
> So, I'm not sure why that rule don't seem to be effective.

Is there any chance that the SetEnvIfNoCase directive is not being
satisfied due to the mod_rewrite rules that I'm using?

All requests are routed through a single file, /index.php, via the
following mod_rewrite directives:

# Rewrite URIs of the form 'index.php?q=x'
# (except for real files/directories):
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

So, a request for the URL
https://localhost/public/download/ will be rewritten
to https://localhost/public/index.php?q=/download/ .

Curiously, if I examine Apache's environment variables after the rewrite
has been performed, the "REQUEST_URI" value is

Given the above, shouldn't the SetEnvIfNoCase directive return a match?

Thanks for any help!


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message