i want to speed up load pages maked by smarty template,i think gzip is good idea. i see this page (this page) but i dont understand how can use this !
- is this best way?
- how can active gzip in smarty template?
i want to speed up load pages maked by smarty template,i think gzip is good idea. i see this page (this page) but i dont understand how can use this !
Smarty (since version 3.0) has a new format of loading the internal sys plugins.
Drop the gzip file in the /plugins dir (ie. outputfilter.gzip.php.) And just before the $smarty->display call:
// example
$smarty->loadFilter('output','gzip');
$smarty->display('tpl/index.html');
//end
You can't use 'load_filter' anymore.
You will want to take a look at the .htaccess file from http://html5boilerplate.com/. It is all you need, put it at the top directory on your web server and apache takes care of the gzip problem.
If you have a .htaccess file already, you need to merge the two.
Once the .htaccess is uploaded and you want to test whether or not it is working, my best tool is FireBug for FireFox using the Net inspector and looking at the response headers. As a fallback try http://www.whatsmyip.org/http_compression/ it will however require the site to online and publicly available.