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/

CS Cart Development Company In India

There is no shortage of CS cart development companies in India and for a well-functioning cart system, it is significant to hire a good company that specializes in designing websites and e-commerce development services. A well-functioning CS cart system can increase the reach of your business and help your business stand out from the other websites. Here we have listed the importance of hiring a CS-Cart Development Company in India and the features you should look for in a company. Significance Of CS-Cart Development Company  CS cart e-commerce system is a widely used and popular shopping cart for e-commerce websites. Features like open sources, easy and free to utilize make this system a unique one. Among all the other carts of shopping, CS cart is popular for its flexibility and easy installation, as it is written completely in PHP language. Aside from that, even managing this system is rather simple and effortless. Various components of HTML, MySQL, etc., are util...