I'm saos@ngmo

Sử dụng GZIP trong template để tăng tốc cho Joomla

by saosangmo on Apr.24, 2009, under Joomla

Compression is a quick and efficient way to save your server bandwidth and speed up your website load time. By adding a piece of PHP code to the top of your Joomla generated Web pages, you can instruct the Web server to compress files for transit to your visitors’ Web browser. This is especially useful for text-heavy Web pages that are over 100K in size.

To Optimize Your Joomla Site with GZIP
Compression

Go to Extension >>Templates Manager
Open your default template and click on Edit Html button

Add the following code to the very top and above the DOCTYPE:

<?php if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], ‘gzip’)) ob_start(“ob_gzhandler”); else ob_start(); ?>

Done.

Note: make sure you have GZIP Page
Compression
turned on in Joomla Global Configuration>>Server

This will decrease website
load time
significantly for sites that are larger than 100k. For sites that are less than 100k in size, it may not have too much affect on page
load time
.

:, ,

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!