Speeding up the site by using PHP GZIP compression
By: Zhiqiang Ma
On: Feb 20, 2010
Views: 63 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:
- How to change the site’s default 404 Error not found page
- Get the Number of All Posts in WordPress
- Friendly WordPress navigation using page numbers instead of next and previous links
- 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!