Cached Categories – HUGE Speed Increase

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:

<?php
include(dirname(__FILE__).'/config/config.inc.php');

if(intval(Configuration::get('PS_REWRITING_SETTINGS')) === 1)
    $rewrited_url = __PS_BASE_URI__;

include(dirname(__FILE__).'/header.php');

$smarty->assign('HOOK_HOME', Module::hookExec('home'));
$smarty->display(_PS_THEME_DIR_.'index.tpl');

include(dirname(__FILE__).'/footer.php');
?>

to

<?php
$dwTimeStart = microtime(true);
include(dirname(__FILE__).'/config/config.inc.php');

if(intval(Configuration::get('PS_REWRITING_SETTINGS')) === 1)
    $rewrited_url = __PS_BASE_URI__;

include(dirname(__FILE__).'/header.php');

$smarty->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]

affiliate_link
Share this Post:
Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

3 Responses to “Cached Categories – HUGE Speed Increase”

Trackbacks are disabled.

  • What version of Prestashop is this module for?

  • Remarkable! Its genuinely amazing article, I
    have got much clear idea regarding from this post.

  • I do agree with all of the ideas you’ve presented
    in your post. They’re very convincing and can certainly
    work. Still, the posts are very quick for beginners.

    May just you please extend them a little from subsequent time?
    Thank you for the post.