Return-Path: Delivered-To: apmail-httpd-bugs-archive@www.apache.org Received: (qmail 70448 invoked from network); 9 Sep 2004 14:52:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 9 Sep 2004 14:52:11 -0000 Received: (qmail 19829 invoked by uid 500); 9 Sep 2004 14:52:09 -0000 Delivered-To: apmail-httpd-bugs-archive@httpd.apache.org Received: (qmail 19794 invoked by uid 500); 9 Sep 2004 14:52:08 -0000 Mailing-List: contact bugs-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: "Apache HTTPD Bugs Notification List" Delivered-To: mailing list bugs@httpd.apache.org Received: (qmail 19778 invoked by uid 99); 9 Sep 2004 14:52:08 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [192.18.33.10] (HELO exchange.sun.com) (192.18.33.10) by apache.org (qpsmtpd/0.28) with SMTP; Thu, 09 Sep 2004 07:52:07 -0700 Received: (qmail 20660 invoked by uid 50); 9 Sep 2004 14:53:50 -0000 Date: 9 Sep 2004 14:53:50 -0000 Message-ID: <20040909145350.20659.qmail@nagoya.betaversion.org> From: bugzilla@apache.org To: bugs@httpd.apache.org Cc: Subject: DO NOT REPLY [Bug 31145] New: - Patch for using mod_deflate to serve pre-compressed pages X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=31145 Patch for using mod_deflate to serve pre-compressed pages Summary: Patch for using mod_deflate to serve pre-compressed pages Product: Apache httpd-2.0 Version: 2.0-HEAD Platform: All OS/Version: Other Status: NEW Severity: Enhancement Priority: Other Component: mod_deflate AssignedTo: bugs@httpd.apache.org ReportedBy: skrul@yahoo.com I want to serve pre-compressed pages rather than using mod_deflate to compress the pages on the fly. However, I also want to send uncompressed pages to browsers that have buggy support for compressed pages and browsers that do not state that they accept compressed pages. The included patch and the following configuration make this possible. Setting the environment variable "force-gunzip" will bypass mod_deflate's checking of the content type of the selected document before it uncompresses it. I need this because my compressed files do not end in ".gz". Also, setting the environment variable "no-gunzip" causes mod_deflate not to uncompress the selected document. # We always serve compressed data, so add the appropriate header Header append Content-Encoding gzip # If the request includes Accept-Encoding: gzip and is a browser that # works with compressed input, tell mod_deflate not to inflate the content SetOutputFilter INFLATE # Skip the content encoding sanity check that verifies that the content # that we might be gunzipping is actually gzipped. We do this becase we # know all of our content is gzipped, but since we don't add the .gz # extension, the content encoding header does not get set. SetEnv force-gunzip 1 # Since all of our content is compressed, we never want to gunzip the # content unless we have a request from a known incompatible browser # or the request does not state that gzipped content is acceptable # in the Accept-Encoding header # Always gunzip the response for Netscpae 4.x, but don't mistakenly include # IE. This is based on the mod_deflate setup in the documentation at: # http://httpd.apache.org/docs-2.0/mod/mod_deflate.html SetEnv bad-browser=0 BrowserMatch ^Mozilla/4 bad-browser=1 BrowserMatch \bMSIE bad-browser=0 # If the browser can accept gzip encoding, don't gunip the response SetEnvIf Accept-Encoding gzip no-gunzip # But if it is a bad browser, re-enable ungzipping by clearing the # no-gunzip environment variable SetEnvIf bad-browser 1 !no-gunzip --------------------------------------------------------------------- To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org For additional commands, e-mail: bugs-help@httpd.apache.org