This is a discussion on mod_deflate twiking within the Apache Web Server forums, part of the Web Server and Related Forums category; Hello, I'm looking for an optimal and cross browser compatible configuration for various MIME types in mod_deflate. To begin ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello,
I'm looking for an optimal and cross browser compatible configuration for various MIME types in mod_deflate. To begin with, I already put in place a dedicated MIME rewriting rule for XHTML to be sent as "test/html" or "application/xhtml+xml" depending on the Accept header. This rule does a nice job so fahr: #Serve xhtml pages as text/html to those that can't do application/xhtml+xml RewriteEngine On RewriteBase / # Http Accept header does not equal "application/xhtml+xml" RewriteCond %{HTTP_ACCEPT} !application/xhtml\+xml # Http Accept header does equal "text/html" OR "*/*" RewriteCond %{HTTP_ACCEPT} (text/html|\*/\*) # Requested filename is anything ending in .xhtml RewriteCond %{REQUEST_FILENAME} .*\.xhtml # Match any url. - is used for no substitution. Set mime-type to text/html. L is for last. I.e. stop processing rules RewriteRule ^.*$ - "[T=text/html,L]" Now, regarding mod_deflate, I run this configuration: <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xhtml+xml application/x-javascript text/css SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|exe|zip|pdf)$ no-gzip dont-vary BrowserMatch "MSIE" gzip-only-text/html BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch "MSIE" brokenvary=1 BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1 BrowserMatch "Opera" !brokenvary SetEnvIf brokenvary 1 dont-vary Header append Vary User-Agent env=!dont-vary </IfModule> This setup work well with Firefox, but documents sent to Internet Explorer 6 and 7 do not get compressed. Is it related to the MIME rewrite rule (above) for "application/xhtml+xml" MIME types ? How to set up mod_deflate to let it compress all compressable documents in a compatible way for various current browsers, _including for XHTML documents_ ? Regards, -- Léa Gris |
| Thread Tools | |
| Display Modes | |
|
|