This module can make page load quickly. It is a mod of the categories block renamed to “blockcategoriescache”. It should be completely independent (renamed files, changed module name, module variable names, etc) so you can just upload and test. You have to update the cache manually every time you change/update your category list
To clock the page generation time to see if there is an increase, add 2 lines in index.php. Change it from this:
assign('HOOK_HOME', Module::hookExec('home'));$smarty->display(_PS_THEME_DIR_.'index.tpl');include(dirname(__FILE__).'/footer.php');?>to
assign('HOOK_HOME', Module::hookExec('home'));$smarty->display(_PS_THEME_DIR_.'index.tpl');include(dirname(__FILE__).'/footer.php');echo(round(microtime(true) - $dwTimeStart, 3) . "s");?>Whenever you load the main page, it will display the seconds it took to generate the page on the bottom.
Installation Instructions:
1.) OPTIONAL – Change the index page as indicated above so you can see performance impact.
2.) OPTIONAL – Load main page 3 times and average page generation times
3.) Download attachment, extract
4.) Upload “blockcategoriescache” to http://www.YOUR-SITE.com/modules/blockcategoriescache
5.) On modules list in prestashop backoffice, uninstall “Categories block” and install “Categories block (Cache)”
6.) Update cache – goto http://www.YOUR-SITE.com/?debug=cat (You will need to do this each time you update categories)
7.) Load page and see speed increase
8.) OPTIONAL – Load main page 3 times and average page generation times. Post old and new times on this thread.
[Download Source Code Here]
Không có nhận xét nào:
Đăng nhận xét