Jump to content
RNBCards

[MODULE (modified)] Cached Categories - HUGE Speed Increase

Recommended Posts

Alright, so my shop was running pretty slow, borderline acceptable, and it is on a VPS. Anyways, after clocking the page generation time (top and bottom of index.php), it came out to 1.5-1.9 seconds to generate the page. Anyways, to cut the story short, I found out the category block was EXTREMELY slow. With it disabled, page generation times dropped to a consistent .31 seconds - over FIVE TIMES FASTER. Then again, my shop has about 100-120 categories, so it might not be as drastic for other people.

Ok, so I know nothing of smarty, however I am good with PHP. And it appears (I think) that the reason it is so slow is because it opens category-tree-branch.tpl again for each separate category when populating the block.

Anyways, attached 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. Also, as I said I don't know smarty, this is very primitive. You have to update the cache manually every time you change/update your category list. Basically, this SHOULD work fine, but I make no guarantees.

Also, 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 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 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.

Anyone very familiar with modules PLEASE look at this to make sure everything is done nicely and stable. Also, I would REALLY appreciate it if people would post old and new page load times here.

Oh, and if you have any issues with it, post here and I will try my best to help.

Thanks!

blockcategoriescache.zip

  • Like 1

Share this post


Link to post
Share on other sites

17 downloads no responses? Does that mean it is working? I spent about an hour on this so the least spend 3 seconds and post if it worked good or even to just say thanks.

Share this post


Link to post
Share on other sites
thx i will try this when i get a chance.


Alright, if you get a chance, use the code above to time it to see the actual increase and post here.

Thanks

Share this post


Link to post
Share on other sites

Wow! I had *just* come to the same conclusion and was going to write my own hack - thanks for doing the leg work!

Share this post


Link to post
Share on other sites
Wow! I had *just* come to the same conclusion and was going to write my own hack - thanks for doing the leg work!


No problem. If you would like to do me a favor, time it to see the increase. I want to know the affect on other's shops.

Share this post


Link to post
Share on other sites

I use caching in smarty template engine. This is example for the manufacturers block
In smarty.config.inc.php

$smarty->force_compile    = false;


In blockmanufacturer.php

function hookLeftColumn($params)
   {
       global $smarty, $link;
//caching on
   $smarty->caching = true;
//check if in cache
   if (!$smarty->is_cached(dirname(__FILE__).'/'.'blockmanufacturer.tpl')) {
//query date if in not cache
           $smarty->assign(array(
               'manufacturers' => Manufacturer::getManufacturers(),
               'link' => $link,
           ));
   }
//generating block
       $page= $this->display(__FILE__, 'blockmanufacturer.tpl');
//caching off
       $smarty->caching = false;
//return block
       return $page;
   }



This smarty caching work in sitemap.php, category.php and other static blocks and pages

http://www.prestadev.ru/forum/tema-1068.html

Share this post


Link to post
Share on other sites
I use caching in smarty template engine. This is example for the manufacturers block
In smarty.config.inc.php
$smarty->force_compile    = false;


In blockmanufacturer.php

function hookLeftColumn($params)
   {
       global $smarty, $link;
//caching on
   $smarty->caching = true;
//check if in cache
   if (!$smarty->is_cached(dirname(__FILE__).'/'.'blockmanufacturer.tpl')) {
//query date if in not cache
           $smarty->assign(array(
               'manufacturers' => Manufacturer::getManufacturers(),
               'link' => $link,
           ));
   }
//generating block
       $page= $this->display(__FILE__, 'blockmanufacturer.tpl');
//caching off
       $smarty->caching = false;
//return block
       return $page;
   }



This smarty caching work in sitemap.php, category.php and other static blocks and pages

http://www.prestadev.ru/forum/tema-1068.html



Yea, but the trouble is the category block is not static. For ex. when you expand a category, and click a subcategory, on the new page the category will be expanded. It expands all parent categories of the current one. You can use caching, but I'm fairly certain you won't be able to get it to auto expand.

Share this post


Link to post
Share on other sites

In blockmanufacturer.php After

$page= $this->display(__FILE__, 'blockmanufacturer.tpl');


Add

       if (isset($_GET['id_category']))
       {
           $cookie->last_visited_category = intval($_GET['id_category']);
           $currentCategoryId=intval($_GET['id_category']);    
       }
       if (isset($_GET['id_product']))
       {            
           if (!isset($cookie->last_visited_category) OR !Product::idIsOnCategoryId(intval($_GET['id_product']), array('0' => array('id_category' => $cookie->last_visited_category))))
           {
               $product = new Product(intval($_GET['id_product']));
               if (isset($product) AND Validate::isLoadedObject($product))
                   $cookie->last_visited_category = intval($product->id_category_default);
           }
           $currentCategoryId=intval($cookie->last_visited_category);
       }    
$page.="[removed]$('#cat_".$currentCategoryId."').addClass('selected');[removed]";


And in category-tree-branch.tpl replace



with


Share this post


Link to post
Share on other sites

Hey great module. I tried step 6, but it didnt create the cache for the module.

The funny thing is that I tried it on my local server and it work, so I just updated the cache file from the local to the live one.

This is how I inputted step 6:

http://www.mysite.net/folder/testsite/?debug=cat

But this didnt work. Any ideas?


Thanks

gdinari

Share this post


Link to post
Share on other sites

I have a little language problem with the headertext of the block. I want to change the name Categories to something else but I can't find where to change it. Any idea? Besides that it works perfect and loads 1.5 secs faster for me then the 'old' block.

Share this post


Link to post
Share on other sites
I have a little language problem with the headertext of the block. I want to change the name Categories to something else but I can't find where to change it. Any idea? Besides that it works perfect and loads 1.5 secs faster for me then the 'old' block.


Edit blockcategoriescache.tpl.

Change "

{l s='Categories' mod='blockcategoriescache'}

"
to "

{l s='Name Goes Here' mod='blockcategoriescache'}

"


Hey great module. I tried step 6, but it didnt create the cache for the module.

The funny thing is that I tried it on my local server and it work, so I just updated the cache file from the local to the live one.

This is how I inputted step 6:

http://www.mysite.net/folder/testsite/?debug=cat

But this didnt work. Any ideas?


Thanks

gdinari


Check "modules/blockcategoriescache" and see if there is a file named "cat_cache.txt". If not, you could also try changing the permissions of the blockcategoriescache folder. If that doesn't work, post here.

Share this post


Link to post
Share on other sites
In blockmanufacturer.php After
$page= $this->display(__FILE__, 'blockmanufacturer.tpl');


Add

       if (isset($_GET['id_category']))
       {
           $cookie->last_visited_category = intval($_GET['id_category']);
           $currentCategoryId=intval($_GET['id_category']);    
       }
       if (isset($_GET['id_product']))
       {            
           if (!isset($cookie->last_visited_category) OR !Product::idIsOnCategoryId(intval($_GET['id_product']), array('0' => array('id_category' => $cookie->last_visited_category))))
           {
               $product = new Product(intval($_GET['id_product']));
               if (isset($product) AND Validate::isLoadedObject($product))
                   $cookie->last_visited_category = intval($product->id_category_default);
           }
           $currentCategoryId=intval($cookie->last_visited_category);
       }    
$page.="[removed]$('#cat_".$currentCategoryId."').addClass('selected');[removed]";


And in category-tree-branch.tpl replace



with




Yea, that would also work. It's just two different ways of going about it. However I still like my way more because you just drop it in, and in the worst case scenario you just disable the module. When possible, I like to keep away from editing core files. Also, in case of prestashop updates, you don't need to remember each and every change you made.

Share this post


Link to post
Share on other sites

thx for that. I found another problem though.

The module works everywhere except with the "Sendtoafriend module".

When clicking on the Send to a friend button, the form shows up but the Cached Category Block dissapears and a message appears "PLEASE UPDATE
CATEGORY CACHE! ".

I updated the cache before and trying it again doesnt work with the sendtoafriend module.

Any ideas?

Share this post


Link to post
Share on other sites

Thanks !
This module can support multilang website ?

For my website, it only works for one language.

THanks for your help

Share this post


Link to post
Share on other sites

Speed in the old situation was 3.678 s and now it 0.587 s

Thanx Willem

Share this post


Link to post
Share on other sites

Dear RNBCards,

Thank you for improved categories module!

I think it's speed up my website also. Just one question regarding change in index.php file.
I add that two lines of code like was written in your post, but load time only show up in home page.
Is it possible to make it visible in whole website?

Thank you in advance!

Share this post


Link to post
Share on other sites

Thanks for this!
Often noticed loadtime in the high, but with this its atleast under 2sec. (also my current host is useless :/)

3,588
2,577
1,584 pre-cache

1,584
1,549
1,621 after-cache

Share this post


Link to post
Share on other sites

I have not big issue with that module. It works ok, but in page Send this page to a friend it's not working. I got such message:

PLEASE UPDATE
CATEGORY CACHE!

Please, help me to figure out that problem, because that cached categories module really helps me improve my site load time

Share this post


Link to post
Share on other sites

Sad to say it, the Cache bugs like crazy.
Keep getting the update cache error msg on like every payment option on checkout page etc etc..
Have to disable this for now until its fixed :(

Share this post


Link to post
Share on other sites

Found the solution for the "cache error" bug when browsing payment options etc.
It occurs due to a pathing bug in the php file. It cant find the cache textfile.

Around line 146 in blockcategoriescache.php file, find:

$szCache = @file_get_contents("modules/blockcategoriescache/cat_cache.txt");


and replace it with:

$szCache = @file_get_contents(_PS_MODULE_DIR_.'blockcategoriescache/cat_cache.txt');



After that code update it should work with all other modules. (sendtofriend, payment options etc etc)

Best regards
Marcus "Glimpy"

  • Like 1

Share this post


Link to post
Share on other sites
Found the solution for the "cache error" bug when browsing payment options etc.
It occurs due to a pathing bug in the php file. It cant find the cache textfile.

Around line 146 in blockcategoriescache.php file, find:
$szCache = @file_get_contents("modules/blockcategoriescache/cat_cache.txt");


and replace it with:

$szCache = @file_get_contents(_PS_MODULE_DIR_.'blockcategoriescache/cat_cache.txt');



After that code update it should work with all other modules. (sendtofriend, payment options etc etc)

Best regards
Marcus "Glimpy"



Yup works! Thanx allot for posting your solution!

Share this post


Link to post
Share on other sites

Thanks a lot for this RNBCards! In average i went from 1.3s to 560ms according to Firebug. Excellent :)

Share this post


Link to post
Share on other sites

great work..!
shaves 1.5 sec from my loading times :)

but didn't work on a multi lang site..
so i've adapted it a bit

on the debug?cat command it now creates multiple cache files (one for each language)
and simply loads the one needed.

blockcategoriescache.php

Share this post


Link to post
Share on other sites

I've been using this great module for awhile now, but I would like to change the order of the categories in this block so its not displayed alphabatic.
I know I can use numerics in front of the category names like 01. 02. etc but thats not what I want.

Right now I'm using the standard category block again with a module that lets me change the order in the backend, but this module is not working for the Category Cache module unfortunately.

Anyone knows how to achieve this because the change in speed is really nice?

Share this post


Link to post
Share on other sites

Hi Folks

Has anyone else had problems with https pages having this module as unsecure...if so anyone have a solution to this


Best regards

Wayne

Share this post


Link to post
Share on other sites

Hey guys, sorry for not replying in a while. I have been really busy with other things recently. Thanks a lot to Glimpy for the fix and willem-010 for both of the fixes. In the next few days I'll try to fix it up and update the main post.

Share this post


Link to post
Share on other sites

Excellent module. I also hope you can have the categories display according to sort order.

Share this post


Link to post
Share on other sites

It seem that this was such a good idea that the Prestashop team have added category caching to v1.4

Share this post


Link to post
Share on other sites

Hi, I use the mod for a long time. It works great, my store has over 5thousand categories. Is it possible to view a number of products in the category tree. It is important for me to show all product categories even subcategories. For example

-category_name1 (25).
-category_name2 (14).


I realize that I must debbuging and create files cache to display the current number of displayed products

I ask to help me
Greetings,
Manver.

PS: I hope that I clearly presented a problem because my English is not perfect

Share this post


Link to post
Share on other sites

Excellent module. I used this and my site can speed in one second! But now, I move to another hoster, and it takes up to 10 seconds! :(

Any idea, please help? I have re-installed this module, but found no faster.

Share this post


Link to post
Share on other sites

Loading time before (average of 5): 0.756
Loading time after (average of 5): 0.691

It isn't a very large shop and the difference is little but with several of these tricks it's easy to decrease the loading time. Good job!

Share this post


Link to post
Share on other sites

Thanks so much for this module! My store's webpage was terribly slow, and now loads with lightning speed. My categories list, including all subcategories, is over 400. Average speed before change was 5.701 seconds. Now the page loads on average in .732 seconds...6.7 times faster!!

There is one issue I would like to resolve though. Before the change, my categories list appeared near the top of the left column, but now is at the bottom, below everything else. I need to have the list where it is visible when the page is loaded. I now have to scroll down before it appears. What can I do to move it back to the top where it was originally? This may be a very simple solution, but I am a complete novice when it comes to dealing with the code. Any help would be greatly appreciated. Thanks! :)

Share this post


Link to post
Share on other sites
@3rtt

go to modules then positions and click the black arrow up to the position you want it at.

Regards,

Mark



Thanks Mark, that was just what I needed to know! Like I said, I'm a novice at this. :)

Share this post


Link to post
Share on other sites

The best thing ever developed for Prestashop!!

I can't thank you enough.....wow....simply wow

I have one question though. When I click on a submenu and want the items to displayed, there is also a bit of loading time there. Can this be increased also?

Again, thanks so much for this module

Share this post


Link to post
Share on other sites

Hi
I've used this excellent module for a while now and it has really improved the performance of the site. However it doesn't seem to catch up when I add new product categories. I've checked the .txt file and the new category is not in there. What do I have to do the "clear" the cache and reload it?

BR
Henrik

Share this post


Link to post
Share on other sites
Hi
I've used this excellent module for a while now and it has really improved the performance of the site. However it doesn't seem to catch up when I add new product categories. I've checked the .txt file and the new category is not in there. What do I have to do the "clear" the cache and reload it?

BR
Henrik


Hi

You have to manually update it. Let's say your site is called "wennergren"
Type this in your browsers adress line: http://www.wennergren/?debug=cat

Then the categories block will update
  • Like 1

Share this post


Link to post
Share on other sites

I have tried this one, everythink went fine but my translation dont.

I went by ur instructions, got this module working, I created cs.php file in module folder (For czech language)
Edited translations in administration, everythnig went well, but at the site, its still in englich (i mean that title "CATEGORIES")

atributes are OK, translations saved, but only its still in english

Module translations in administrations works fine... in modules folder, all in czech, in positions, all in czech
at the main page.. english... any solution please?

EDIT: and another bug: this cache module does not provide any multilangual support... I have two languages at my shop but when its cached, its all cached only in one language

Share this post


Link to post
Share on other sites

According to Chrome Resources i had a total loadtime of aprox 5-6 sec before. Loaded in 2.82 after new categories module where installed. This is total loadtime tough, with facebook iframe etc. But it looks to have saved me those seconds for real if I check the timeline.

Thanx, beutiful module modification.

Noticed it didn't work in ps 1.4, will this be fixed or does anybody know if cache handling is better in 1.4?

Share this post


Link to post
Share on other sites
Alright, so my shop was running pretty slow, borderline acceptable, and it is on a VPS. Anyways, after clocking the page generation time (top and bottom of index.php), it came out to 1.5-1.9 seconds to generate the page. Anyways, to cut the story short, I found out the category block was EXTREMELY slow. With it disabled, page generation times dropped to a consistent .31 seconds - over FIVE TIMES FASTER. Then again, my shop has about 100-120 categories, so it might not be as drastic for other people.

Ok, so I know nothing of smarty, however I am good with PHP. And it appears (I think) that the reason it is so slow is because it opens category-tree-branch.tpl again for each separate category when populating the block.

Anyways, attached 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. Also, as I said I don't know smarty, this is very primitive. You have to update the cache manually every time you change/update your category list. Basically, this SHOULD work fine, but I make no guarantees.

Also, 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 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 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.

Anyone very familiar with modules PLEASE look at this to make sure everything is done nicely and stable. Also, I would REALLY appreciate it if people would post old and new page load times here.

Oh, and if you have any issues with it, post here and I will try my best to help.

Thanks!



I have used and find difference

Before category cash block
1.517s
1.599s
1.405s
Avg 1.507

After category cash block
1.398s
1.386s
1.385s
Avg 1.390

thanks

Share this post


Link to post
Share on other sites

This module made a great difference in speed but I have problems in https, categories don't show at all.

Anyone know how to solve this?

Regards,

Mark.

Share this post


Link to post
Share on other sites

Great module !!

38% speed increase !




I have tried this one, everythink went fine but my translation dont.

I went by ur instructions, got this module working, I created cs.php file in module folder (For czech language)
Edited translations in administration, everythnig went well, but at the site, its still in englich (i mean that title "CATEGORIES")

atributes are OK, translations saved, but only its still in english

Module translations in administrations works fine... in modules folder, all in czech, in positions, all in czech
at the main page.. english... any solution please?

EDIT: and another bug: this cache module does not provide any multilangual support... I have two languages at my shop but when its cached, its all cached only in one language


The same problem, but in slovak, try to manually edit cat_cache.cz.txt, then works fine

Share this post


Link to post
Share on other sites
This module made a great difference in speed but I have problems in https, categories don't show at all.

Anyone know how to solve this?

Regards,

Mark.



Does anyone know how to correct this please?

Regards,

Mark.

Share this post


Link to post
Share on other sites

Is anyone else using this module and having trouble with https?

I want to use this module but categories don't load up when in https for me.

Any help would be appreciated.

Regards,

Mark.

Share this post


Link to post
Share on other sites

Hi to everybody,

In my case it doesn't speeds up too much, but anything contributing speed is very acceptable. Great job!

My problem is that HomeCategories module shows a message saying "No categories available", when I uninstall
the blockcategories and install the blockcategoriescache.

The thing is that when i put "www.novodistribuciones.com/?debug=cat, it generates all the lang files (I use the multilang version) and the HomeCategories are shown, but when i click again to the home page or type "www.novodistribuciones.com", it says that message.

Has anybody had the same behaviour in this module?

Share this post


Link to post
Share on other sites
Is anyone else using this module and having trouble with https?

I want to use this module but categories don't load up when in https for me.

Any help would be appreciated.

Regards,

Mark.


I'm using https, and the category shows even after I installed the cashe module.

I run PS 1.3.1.1.

Great module (i have very few categories, but it's slighty better load times in average.

Share this post


Link to post
Share on other sites

Average speed before: 1.597
Average speed after mod: 0.68

Thanks so much!

Share this post


Link to post
Share on other sites

Why when i install this module it tells: PLEASE UPDATE CATEGORY CACHE!

Which is the updated version of the module?

Share this post


Link to post
Share on other sites
great work..!
shaves 1.5 sec from my loading times :)

but didn't work on a multi lang site..
so i've adapted it a bit

on the debug?cat command it now creates multiple cache files (one for each language)
and simply loads the one needed.



Is it possible to add to link to each category /lang-xx/ ?? ... for i.e.:

change http://www.halo.com/1-fruit to http://www.halo.com/lang-xx/1-fruit

And correction of translation of "category" in each language.

Share this post


Link to post
Share on other sites

I always get: PLEASE UPDATE CATEGORY CACHE!
Can anybody help me to install correctly this module?

Share this post


Link to post
Share on other sites

great module!!!

Works fine @ PS 1.3.7

before
3.463 s
1.354 s
1.200 s

after
1.29 s
1.17 s
1.207 s

Not extremely faster, but that's because my site is still empty ;-)

until now, no errors.

Keep on the good work!

Share this post


Link to post
Share on other sites

I am still using PS 1.3.7.0. module works except I am facing a problem in combination with Friendly URL.
When I'm using this module, Friendly URL does not work on categories-pages....

Anybody facing the same??

Share this post


Link to post
Share on other sites

Hi there!

I have PS1.4.7, server with standard configuration on home.pl (pay about 50E/year). Have ~2400 products, ~200 categories. Two languages.

Have this results:

 

1. without buffering (standard PS option):

1,223; 1,218; 1,173; 1,284; 1,23

average: 1,2256

 

 

2. with file buffering (deep=1):

1,286; 1,224; 2,953; 1,273; 1,39

average with 5 results: 1,6252

average without the worst result (bad moment of internet ;p): 1,29325

 

 

3. with RNBCards cache (and multilanguage modification):

1,199; 1,227; 1,175; 1,246; 1,164; 1,215

average: 1,2043(3)

 

 

So I see, on my server and with my product list buffering to file is useless... Your cache can help me with timing and for that many thanks.

But, I see, many of people there have results under 1sec. My question is: what is your server (standard or VPS, see RNBCards have VPS) because whant too know why have worse results. Also have 2 advertisings and Facebook module on site - think it is timeless for generating site.

If there is a solution to have better result I will use this modification, if not I will stay where I am because of 20ms, until my eshop will grow up ;)

 

greetings!

Edited by alex2c (see edit history)

Share this post


Link to post
Share on other sites

Hi all,

Any news on getting the module to work with the latest PS version (1.5.2)

 

Cheers

Andy

Share this post


Link to post
Share on other sites

Hi all,

Any news on getting the module to work with the latest PS version (1.5.2)

 

Cheers

Andy

In 1.5 branch it should not be necesarry anymore, as there is already a caching solution implemented in core for the menus.

Share this post


Link to post
Share on other sites

Cheers urecheatu007,

I've nearly finished changing over to 1.5 and found that the website was considerably slower than the last version. I have around 26000 products and over 300 categories. I automatically thought it was the categories block was slowing it down.

 

1.5 surely cant be slower than the previous versions?

 

Andy

Share this post


Link to post
Share on other sites

Well, i didn't say that :), aldo from my experience so far 1.5 it is quite fast.

You better check for 404 errors during page loading (if your theme use custom modules templates / stylesheets it is rather easy to miss some calls to images), they tend to greatly enlarge the page load time.

Also, ccc and cache enabled help a lot.

Share this post


Link to post
Share on other sites

great work..!

shaves 1.5 sec from my loading times :)

 

but didn't work on a multi lang site..

so i've adapted it a bit

 

on the debug?cat command it now creates multiple cache files (one for each language)

and simply loads the one needed.

 

Hi willem-010,

 

Nice fix, but I still have a bug on multilingual sites.

 

When you launch "?debug=cat" it creates a txt file for each of my language as it does. Great.

 

But a small bug remains. I have 2 languages on my Prestashop: EN / FR

If I launch "?debug=cat" when I'm on the french part of my site (so my cookie is set to FR), it creates the 2 txt files, with correct URLs but the language parameter remains to FR even in the EN txt file.

ie: in EN txt file I have the following URLs -> /fr/english-name-product-123.html and in the FR I have the following one -> /fr/french-name-product-123.html.

I think that's because of your script write the language parameter based on the cookie. Do you have any fix to solve it?

Edited by tomasz_be (see edit history)

Share this post


Link to post
Share on other sites

Hi, I run PS 1.5.4.0 and I have around 300 categories (5 of them are main categories).

With blockcategories module disabled, I get: Smarty Debug Console - Total Time 0.85111

With blockcategories enabled: Smarty Debug Console - Total Time 8.26612

Is there any way to speed this up?

 

Thanks

Share this post


Link to post
Share on other sites

Ok I have managed to bring it down to 4-5 seconds with blockcategories and blocktopmenu module enabled.

With blockcategories enabled and blocktopmenu disabled, the load time is now under 2 seconds.

 

The fix for the blockcategories module can be found here:

http://www.prestashop.com/forums/topic/176681-slow-blockcategoriestpl/page-2?do=findComment&comment=1575982

 

According to user "sarafian", the fix should also work with blocktopmenu.php, but I do not know how to do that.

So if anyone could help me with applying this fix: http://www.prestashop.com/forums/topic/176681-slow-blockcategoriestpl/?do=findComment&comment=870092 to the blocktopmenu module, it would be awesome.

Share this post


Link to post
Share on other sites

Took me a few hours to figure it out but finally with all the modules enabled: Smarty Debug Console - Total Time 1.75756

I wonder why the default PS installation is so poorly optimized.

Share this post


Link to post
Share on other sites

in fact everything depends on host, on well optimised debian host i've got page load about 0,5 - 0,7

Share this post


Link to post
Share on other sites

The module won't work with my prestashop 1.5.6.0

 

My index looks like this:
require(dirname(__FILE__).'/config/config.inc.php');

 

and when I change it 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");?>

 
it only turn white (the frontpage / front-end shop).
 
Any who can help me? =)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More