Hallo Forum,
ich habe einen Apache 2 laufen und möchte Content Negotiation nutzen. In meiner .htaccess steht dazu
AddEncoding x-gzip .gz .tgz
Jetzt habe ich in einem Verzeichnis eine Datei print.css sowie ihre gzipte Variante print.css.gz liegen und referenziere sie mit print. Wenn der User-Agent nun gzip als Encoding akzeptiert, soll er print.css.gz bekommen, ansonsten print.css. Bis hier hin funktioniert das auch, wie sich mit curl -I [--compressed] herausfinden lässt. Der Apache 2 setzt allerdings neben dem Content-Encoding auch den Content-Type, der dann allerdings application/x-gzip lautet:
$ curl --compressed -I http://free-k-sounds.net/style/printHTTP/1.1 200 OK
Date: Wed, 18 Feb 2009 20:37:39 GMT
Server: Apache/2.2.3 (Debian) DAV/2 SVN/1.4.2 mod_python/3.2.10 Python/2.4.4 PHP/5.2.0-8+etch13 mod_ssl/2.2.3 OpenSSL/0.9.8c mod_perl/2.0.2 Perl/v5.8.8
Content-Location: print.css.gz
Vary: negotiate,accept,accept-encoding
TCN: choice
Last-Modified: Sat, 26 Jul 2008 01:40:55 GMT
ETag: "4023d1b-99-619437c0;426408c0"
Accept-Ranges: bytes
Content-Length: 153
Content-Type: application/x-gzip
Content-Encoding: gzip
Die einfache Variante ohne Akzeptanz von komprimierten Inhalten sieht hingegen OK aus:
$ curl -I http://free-k-sounds.net/style/print
HTTP/1.1 200 OK
Date: Wed, 18 Feb 2009 20:54:53 GMT
Server: Apache/2.2.3 (Debian) DAV/2 SVN/1.4.2 mod_python/3.2.10 Python/2.4.4 PHP/5.2.0-8+etch13 mod_ssl/2.2.3 OpenSSL/0.9.8c mod_perl/2.0.2 Perl/v5.8.8
Content-Location: print.css
Vary: negotiate,accept,accept-encoding
TCN: choice
Last-Modified: Sat, 26 Jul 2008 01:34:49 GMT
ETag: "4023d1a-b2-4bc38040;426408c0"
Accept-Ranges: bytes
Content-Length: 178
Content-Type: text/css
Hat jemand eine Idee, woran das liegen könnte?
Viele Grüße,
Robert