Skip to main content

Check and Use GZIP Compression through PHP

gzip compression is using for increase website speed and save server bandwidth. Read the below points to add gzip compression in your website:

1. Ask Hosting server provider to enable gzip compresssion.
2. Compress all the css and js file using 7-zip e.g. if your css file name is style.css it will save as style.css.gz.
3. Upload all the file on live server and set Content Encode GZIP to .gz files
4. Define gzip global variable in your common php file (remember the common file will include in all the php file into your website)
 $gzip_string="";
 if (substr_count($_SERVER["HTTP_ACCEPT_ENCODING"], "gzip"))
 {
 $gzip_string=".gz";
 }else{
 $gzip_string="";
 }


5. Put defined variable in all your script and style including in your php pages e.g.
 <link rel="stylesheet" type="text/css" href="css/my-style-file.css<?php echo $gzip_string;?>" />
 <script type="text/javascript" src="js/my-script-file.js<?php echo $gzip_string;?>"></script>


If you face any problem in gzip compression you can write mail to info@ezeelive.com or Skype on ezeelive

Comments

  1. This is such an interesting blog. You are very knowledgeable about this subject. Please check out my site.
    Freelance Magento Developer

    ReplyDelete

Post a Comment

Popular posts from this blog

Comparison between Prestashop and CS Cart eCommerce System

We (Ezeelive Technologies) are comparison CS Cart with another famouns eCommerce system called Prestashop. Both Prestashop and CS Cart use their own in-build Php MVC pattern. Our development team have find  Prestashop  has such good features like Frontend and Backend Speed, Product Comparison, URL Rewriting, HTML5 Image Uploader, Taxes, Stores Locator etc. Read more :  http://www.ezeelive.com/blog/comparison-prestashop-cs-cart-ecommerce-system/

Advantages of Php Web Development

Now a day PHP has turn out to be the most demanding web programming language for web development. There are several reasons why PHP Development is in great demand these days. If you would like to hire PHP developers to develop your business or not, it's a fine thought to be aware of these advantages associated with the development of PHP to understand your best options. PHP has become one of the most useful web programming platforms, as well as Linux and MySQL . The only costs associated with working with these technologies are the cost of hiring PHP Web developers . Benefits of development in PHP language: 1. It is an open source language therefore it's free. 2.  PHP development provides the best performance at an affordable price which is a great dynamic pages. 3. Coding is very easy to learn 4. PHP language syntax is similar to those of C and C++ languages. 5. Any changes to the site during or after the development can be done easily. 6. The framework and the