Skip to main content

How to reduce your web page size? How to enable GZIP compression on your website?

Reducing Your web page size will improve the page load time. Thanks to GZIP, the software application developed by Jean-loup Gailly and Mark Adler , when installed on server will significantly reduce the page size.

You can check whether GZIP is enabled on your server by checking your web page on checkgzipcompression.com.
Sometimes even though there is GZIP installed in your server, your website might not be using it. Enabling GZIP Compression can reduce page size by 70% and speed up the page loading for users.

If it is Apache webserver, add following script in .htaccess of your website to invoke GZIP compression.



<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>



After uploading the .htaccess file, do a GZIP compression test by clicking here or by loading https://varvy.com/tools/gzip/

If this did not work, then try following code instead and do the GZIP test again.

AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

GZIP compression is highly recommended action for SEO optimised landing pages. Quick loading of pages is one among the criteria for perfectly optimised pages.

References:
  1. Wiki Page for GZIP : https://en.wikipedia.org/wiki/Gzip
  2. https://checkgzipcompression.com
  3. https://varvy.com/pagespeed/enable-compression.html
  4. https://varvy.com/tools/gzip/

Popular posts from this blog

Strange problem occured while trying to create a CSV file using PHP Script - The file is not seen on FTP but can download using file's absolute path url

Strange problem occured while trying to create a CSV file - The file is not seen on FTP but can download using file's absolute path url Last day I came across a strange problem when I tried to create a csv file on therver using a PHP script. the script was simply writing a given content as a csv file. The file will be created runtime. What happened was, The script executed fine, file handler for new file was created and contents was wrote into the file using fwrite and it returned the number of bytes that was written.

How to get the Query string of a URL using the Javascript (JS)?

JS function get the Query string of a URL or value of each parameter using the Javascript(JS)? If you want to get your current page's url var my_url=document.location; to get the query string part of the url use like this: var my_qry_str= location.search; this will return the part of the url starting from "?" following by query string Lets assume that your current page url is http://www.crozoom.com/2013/page.html?qry1=A&qry2=B then the location.search function will return " ?qry1=A&qry2=B " to exclue "?", do like this:


Urgent Openings for PHP trainees, Andriod / IOS developers and PHP developers in Kochi Trivandrum Calicut and Bangalore. Please Send Your updated resumes to recruit.vo@gmail.com   Read more »
Member
Search This Blog