Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 21189 invoked from network); 4 Oct 2010 13:32:15 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 4 Oct 2010 13:32:15 -0000 Received: (qmail 55228 invoked by uid 500); 4 Oct 2010 13:32:12 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 54990 invoked by uid 500); 4 Oct 2010 13:32:09 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 54982 invoked by uid 99); 4 Oct 2010 13:32:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Oct 2010 13:32:08 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.216.45] (HELO mail-qw0-f45.google.com) (209.85.216.45) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Oct 2010 13:32:01 +0000 Received: by qwk4 with SMTP id 4so4541704qwk.18 for ; Mon, 04 Oct 2010 06:31:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.104.220 with SMTP id q28mr6691964qao.371.1286199085997; Mon, 04 Oct 2010 06:31:25 -0700 (PDT) Received: by 10.229.62.143 with HTTP; Mon, 4 Oct 2010 06:31:25 -0700 (PDT) Date: Mon, 4 Oct 2010 14:31:25 +0100 Message-ID: From: Ben Short To: users@httpd.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Subject: [users@httpd] Pre compressed css and javascript Hi, I have configured my httpd instance to serve pre-compressed css and java script. But I have two issues. My httpd configuration is as follows. RewriteEngine On RewriteLog "logs/rewrite.log" RewriteLogLevel 5 AddEncoding gzip .gz RewriteCond %{HTTP:Accept-encoding} gzip RewriteCond %{HTTP_USER_AGENT} !Safari # is the request for a js or css file? RewriteCond %{REQUEST_FILENAME} ^(.*).(js|css)$ # is there a gziped version of the file? RewriteCond %{REQUEST_FILENAME}.gz -f RewriteRule ^(.*)$ $1.gz [QSA,L] Issue 1 is that the last RewriteCond never matches even though I can request the gz version directly from the browser. Odly I have no non gzipped version of the file on the server so requesting it results in me being served the gzipped version. 192.168.1.46 - - [04/Oct/2010:14:25:34 +0100] [www.journeycheck.southwesttrains.co.uk/sid#973c5d8][rid#98ab4c0/initial] (2) init rewrite engine with requested uri /southwesttrains/main.css 192.168.1.46 - - [04/Oct/2010:14:25:34 +0100] [www.journeycheck.southwesttrains.co.uk/sid#973c5d8][rid#98ab4c0/initial] (3) applying pattern '/favicon.ico' to uri '/southwesttrains/main.css' 192.168.1.46 - - [04/Oct/2010:14:25:34 +0100] [www.journeycheck.southwesttrains.co.uk/sid#973c5d8][rid#98ab4c0/initial] (3) applying pattern '^(.*)$' to uri '/southwesttrains/main.css' 192.168.1.46 - - [04/Oct/2010:14:25:34 +0100] [www.journeycheck.southwesttrains.co.uk/sid#973c5d8][rid#98ab4c0/initial] (4) RewriteCond: input='gzip,deflate' pattern='gzip' => matched 192.168.1.46 - - [04/Oct/2010:14:25:34 +0100] [www.journeycheck.southwesttrains.co.uk/sid#973c5d8][rid#98ab4c0/initial] (4) RewriteCond: input='/southwesttrains/main.css' pattern='^(.*).(js|css)$' => matched 192.168.1.46 - - [04/Oct/2010:14:25:34 +0100] [www.journeycheck.southwesttrains.co.uk/sid#973c5d8][rid#98ab4c0/initial] (4) RewriteCond: input='/southwesttrains/main.css.gz' pattern='-f' => not-matched 192.168.1.46 - - [04/Oct/2010:14:25:34 +0100] [www.journeycheck.southwesttrains.co.uk/sid#973c5d8][rid#98ab4c0/initial] (1) pass through /southwesttrains/main.css Issue 2 is that although the browser has the following warning when loading the page. FireFox: Warning: The stylesheet http://www.journeycheck.southwesttrains.co.uk/southwesttrains/main.css was loaded as CSS even though its MIME type, "application/x-gzip", is not "text/css". Source File: http://www.journeycheck.southwesttrains.co.uk/southwesttrains/index.html Line: 0 Chrome: Resource interpreted as stylesheet but transferred with MIME type application/x-gzip. Any help would be appreciated. Regards Ben --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org