- Category: Website Development
- Published: 09 July 2014
- Hits: 1912
On the computer, you often use WinRAR software to compress the files to a ZIP and RAR format that have size much smaller than the original file. This will help you send those files easily and speedily. GZIP Compression works similar to WinRAR but not on your computer, which is on the server. GZIP compressed folder that contains the Web pages.
1. HOW WAS CONTENT DISPLAYED BY BROWSER?
For a more visual look, you will proceed to save a web page by selecting the "Save Page As..." in Google Chrome browser » Click Save to finish saving the Web page.
You saved the necessary files to display the web in the browser. "Vandon.com.vn" web page will be displayed in the browser, regardless of your computer with a network connector or not by clicking the "Van Don Wordpress Tutorial Joomla Tutorial Viet Nam Travel.htm" file that you simply downloaded.
Usually, if you have not downloaded the page on your computer yet, you will bear to post a request to the server to download the html file and folders containing such files to display web content in the browser.
Conversely, when you load the page, you simply click on the htm file. The browser will arrange and use the downloaded files on the computer to display web content. That's the reason why networking is not demanded, the machine can also view the substance on the "vandon.com.vn" page by clicking the htm file that you simply downloaded.
More simply, each piece is a file in the folder which you downloaded from the vandon.com.vn’s web server. Browsers that use the pieces, arrange them into a complete picture, the web page that you visit.
2. WHY CAN GZIP COMPRESSION HELP INCREASE THE SPEED OF YOUR WEBSITE?
As the lesson above, if you are not using GZIP, if you want to see content "vandon.com.vn" site, you enter the address (vandon.com.vn) into your browser. The browser must send requests to the server that required 1 html file and 1 folder contains the files needed to display web content with a full capacity of 1582.4 KB.
When you compress these folders, capacity will be only 663 KB, fell more than 2 times the capacity. That is all neumay GZIP Compression to compress use, 1582.4 KB instead sent to the browser, the server must send only 1 size smaller than 663 KB to the browser. Browser, extract and display content. Download size that is smaller than the display of this site will quickly hon.Dieu This makes the transmission more efficient, saving time and bandwidth, as well as significantly improve the speed of your website.
3. ENABLE GZIP COMPRESSION ON THE WEBSERVER
A. METHOD 1
If your Web server is Apache, you open the htaccess file which located in the source directory of the server and paste the following code into:
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
Note: With the Web site using a Windows server, htaccess file can not be applied. Then this mode cannot be used with Windows hosts.
B. METHOD 2: USE GZIP WITH WORDPRESS
With the WordPress'S new version, you can log in to the Wordpress admin page.
After a successful login, the browser's address bar, type: "your_domain_name/wp-admin/options.php". For example, your domain name is vandon.com.vn, you would type in the address bar: "vandon.com.vn / wp-admin / options.php". One time there, you will see:
You see Settings feature is selected. But in fact, this configuration is hidden. But when you log in using the administrator account and insert the path in the address bar, you can see All Settings page. Here, you can activate the feature that Wordpress gives your website.
Roll down, seek the gzipcompression line. By default its value is 0. Altering this value to 1, you will successfully activate GZIP Compression features.
4. EXAMINATION RESULTS AFTER COMPRESSION
When using GZIP Compression testing tool (http://checkgzipcompression.com/zip) for vandon.com.vn site:
As you see, uncompressed size is 22 533 bytes and 5913 bytes are capacity, which was compressed, cut size and almost 4 times the bandwidth savings of 73.8%. This will significantly increase the speed of your website.