| | 133 | $gzip = <<<EOS |
| | 134 | <IfModule mod_headers.c> |
| | 135 | # Make sure proxies don't deliver the wrong content |
| | 136 | Header append Vary User-Agent env=!dont-vary |
| | 137 | </IfModule> |
| | 138 | |
| | 139 | <IfModule mod_deflate.c> |
| | 140 | # Insert filters |
| | 141 | AddOutputFilterByType DEFLATE text/plain |
| | 142 | AddOutputFilterByType DEFLATE text/html |
| | 143 | AddOutputFilterByType DEFLATE text/xml |
| | 144 | AddOutputFilterByType DEFLATE text/css |
| | 145 | AddOutputFilterByType DEFLATE text/javascript |
| | 146 | AddOutputFilterByType DEFLATE application/xml |
| | 147 | AddOutputFilterByType DEFLATE application/xhtml+xml |
| | 148 | AddOutputFilterByType DEFLATE application/rss+xml |
| | 149 | AddOutputFilterByType DEFLATE application/javascript |
| | 150 | AddOutputFilterByType DEFLATE application/x-javascript |
| | 151 | AddOutputFilterByType DEFLATE application/json |
| | 152 | AddOutputFilterByType DEFLATE application/x-json |
| | 153 | AddOutputFilterByType DEFLATE application/x-httpd-php |
| | 154 | AddOutputFilterByType DEFLATE application/x-httpd-fastphp |
| | 155 | AddOutputFilterByType DEFLATE image/svg+xml |
| | 156 | |
| | 157 | # Drop problematic browsers |
| | 158 | BrowserMatch ^Mozilla/4 gzip-only-text/html |
| | 159 | BrowserMatch ^Mozilla/4\.0[678] no-gzip |
| | 160 | |
| | 161 | # IE5.x and IE6 get no gzip, but 7+ should |
| | 162 | BrowserMatch \bMSIE\s[789] !no-gzip !gzip-only-text/html |
| | 163 | # IE 6.0 after SP2 has no gzip bugs |
| | 164 | BrowserMatch \bMSIE.+SV !no-gzip |
| | 165 | # Opera occasionally pretends to be IE with "Mozilla/4.0" |
| | 166 | BrowserMatch \bOpera !no-gzip |
| | 167 | </IfModule> |
| | 168 | |
| | 169 | EOS; |
| | 170 | $rules = $gzip . $rules; |