Does your site run as quickly as it could? It’s worth your time to find out. Faster web sites sell more products, improve user satisfaction, and even rank higher in Google searches.
Note: This tip was written for IBM i but could be adapted for other platforms as well.
Compression adds speed
How to enable compression in 3 steps
1. Edit your Apache configuration file, located at /www/myserver/conf/httpd.conf (replace myserver with your instance name. This is a simple text file, so you may choose from several editors: IBM’s HTTP Server Admin GUI at port 2001 (if *ADMIN is started), the WRKLNK/EDTF command, or your favorite text editor.
2. Add the following two directives to the httpd.conf’s main section:
3. Restart Apache via the HTTP Server Admin page or STRTCPSVR SERVER(*HTTP) RESTART(*HTTP) HTTPSVR(MYSERVER)
Measure the improvement
I ran before-and-after tests using a sample script included with Zend Server for IBM i: http://your-server:10088/Samples/SQL_access/DB2_SQL_example.php.
Before compression: 31kb, loaded in 250ms (milliseconds). See the Firebug report below (Firebug is an optional add-on for Firefox and is not required.)
After compression: 4.4kb; loaded in 109ms. That’s only 14% of the size and 50% of the time! See the screen shot below.
I highly recommend that you give output compression a try. Your HTTP Server for IBM i pages will fly!
For more information on browser output compression, see: http://httpd.apache.org/docs/2.0/mod/mod_deflate.html