Speeding up the site by using PHP GZIP compression
By: Zhiqiang Ma
On: Feb 20, 2010
Views: 59 No Comment
Print
Email
Tags: php, tutorials, Web, wordpress
Tags: php, tutorials, Web, wordpress
Compression is a simple way to speed up the site. PHP’s gzip compression is excellent. And using it is very convenient:
Simply put these codes before any HTML content at the beginning of the PHP script:
<?php if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start(); ?>
In WordPress, the suitable position for these codes is the beginning of the header.php file of the theme.
Read more:
- Get the number of all posts in WordPress
- Friendly WordPress navigation using page numbers instead of next and previous links
- WordPress Theme: ZM Theme
- How to redirect WordPress feed to feedburner using .htaccess
- Change WordPress’s excerpt length
- Use excerpt in index, category, tag and arhieve pages for WordPress


















Leave your response!