| | 133 | if ( apache_mod_loaded('mod_deflate') ) { |
| | 134 | $gzip = <<<EOS |
| | 135 | <IfModule mod_deflate.c> |
| | 136 | # Insert filters |
| | 137 | AddOutputFilterByType DEFLATE text/plain |
| | 138 | AddOutputFilterByType DEFLATE text/html |
| | 139 | AddOutputFilterByType DEFLATE text/xml |
| | 140 | AddOutputFilterByType DEFLATE text/css |
| | 141 | AddOutputFilterByType DEFLATE application/xml |
| | 142 | AddOutputFilterByType DEFLATE application/xhtml+xml |
| | 143 | AddOutputFilterByType DEFLATE application/rss+xml |
| | 144 | AddOutputFilterByType DEFLATE application/javascript |
| | 145 | AddOutputFilterByType DEFLATE application/x-javascript |
| | 146 | AddOutputFilterByType DEFLATE application/x-httpd-php |
| | 147 | AddOutputFilterByType DEFLATE application/x-httpd-fastphp |
| | 148 | AddOutputFilterByType DEFLATE image/svg+xml |
| | 149 | |
| | 150 | # Drop problematic browsers |
| | 151 | BrowserMatch ^Mozilla/4 gzip-only-text/html |
| | 152 | BrowserMatch ^Mozilla/4\.0[678] no-gzip |
| | 153 | BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html |
| | 154 | |
| | 155 | # Make sure proxies don't deliver the wrong content |
| | 156 | Header append Vary User-Agent env=!dont-vary |
| | 157 | </IfModule> |
| | 158 | |
| | 159 | EOS; |
| | 160 | $rules = $gzip . $rules; |
| | 161 | } |