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.
Latest posts by Eric Zhiqiang Ma (see all)
- Vim Tutorial for Beginners: vimtutor - Dec 31, 2016
- Essential Gnome Shell Extensions for Gnome 3 Users - Oct 22, 2016
- How to Install 32-bit Wine 1.8 on CentOS 7 - Oct 16, 2016