[wp-trac] [WordPress Trac] #10365: Gzip compression should be offered by default in Wordpress
WordPress Trac
wp-trac at lists.automattic.com
Tue Dec 15 09:40:32 UTC 2009
#10365: Gzip compression should be offered by default in Wordpress
--------------------------------+-------------------------------------------
Reporter: caesarsgrunt | Owner:
Type: feature request | Status: reopened
Priority: normal | Milestone: 3.0
Component: Optimization | Version:
Severity: normal | Resolution:
Keywords: gzip, compression, |
--------------------------------+-------------------------------------------
Comment(by Denis-de-Bernardy):
Still, it causes tremendous amounts of problems on some servers, and this
is really something you want to deal with from apache. In your htaccess
file, add:
{{{
<IfModule mod_deflate.c>
# Insert filters
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/x-httpd-php
AddOutputFilterByType DEFLATE application/x-httpd-fastphp
AddOutputFilterByType DEFLATE image/svg+xml
# Drop problematic browsers
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</IfModule>
}}}
Doing so is a lot less resource intensive that php's ob_gzhandler, it's
much faster, and it avoids potential double compression problems.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/10365#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list