This plugin allows your WordPress blog to output pages compressed in gzip format if a browser supports compression.
You can now find the plugin listed in WordPress.org.
Coding the Plugin
- I noticed once I installed WordPress and started using it for desalasworks.com that it does not support gzip HTTP compression, apparently this support was removed from version 2.5 onwards.
- HTTP Compression is a no-brainer for optimising your blog. HTTP compression generally means a 60-80% reduction in page size (and broadband usage) as well as an increase in download speeds of 3x to 4x.
- As of January 2010, more than 99% of browsers support compression. For the less than 1% that do not, WordPress will still send them uncompressed pages.
- Having already enabled compression on my own VisualSite (.NET) Content Management System I decided to write a plugin for WordPress to enable this as well.
- The key component of the plugin is a call to the zlib PHP compression library as follows
- if(!ob_start(“ob_gzhandler”)) ob_start();
- For more information have a look here: PHP ob_gzhandler
Download The Plugin
Installing the Plugin
- Download the `wp-http-compression.zip` plugin to your desktop.
- Navigate to the ‘Plugins’ menu in WordPress
- Click ‘Add New’.
- Select ‘Upload’ from the options at top of the page.
- Select the file `wp-http-compression.1.0.zip` and press ‘Install Now’.
- You should get a message saying ‘Plugin Installed successfully’.
- Activate the plugin.
- Go to http://ismyblogworking.com/ to test compression
- Check “Page GZip” on the right hand size.
- Check “Bandwidth saved by compression” on the left hand side.