Speeding Up the Site by Using PHP GZIP Compression

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.

Similar Posts

  • Bash comparison operators

    What are all the bash supported comparison operators? The man 1 test contains all the operators supported in bash. An omitted EXPRESSION defaults to false. Otherwise, EXPRESSION is true or false and sets exit status. It is one of: ( EXPRESSION ) EXPRESSION is true ! EXPRESSION EXPRESSION is false EXPRESSION1 -a EXPRESSION2 both EXPRESSION1…

  • Free server images – SysTutorials QA

    Any free server images? 24 Free Data Center Photos from fatcow.com 24 Free Data Center Photos: http://www.fatcow.com/data-center-photos From Wikimedia commons: Multiple servers: http://commons.wikimedia.org/wiki/File:Server-multiple.svg Server: http://commons.wikimedia.org/wiki/File:Server.svg Yellow server: http://commons.wikimedia.org/wiki/File:Server-yellow.svg Green server: http://commons.wikimedia.org/wiki/File:Server-green.svg More from clker.com: Web Virtualization Server clip art: http://www.clker.com/clipart-1826.html Small Case Web Mail Server clip art: http://www.clker.com/clipart-1902.html Inside our data centers from Google —…

  • New Mingle Forum Class

    Hi , Thank you for your recommendation for removing the canonical link for the forum page only. However, I am am not able to find the following code in the wpf.class.php and was hoping you let us know where we can find this class so that we can modify it accordingly. (Does -1260 refer to…

Leave a Reply

Your email address will not be published. Required fields are marked *