This is not exactly a bug but it is a performance issue for stores with lots of categories.
We have a store here: http://www.lynallan.com/
We have a lot of categories in the top menu and also on sub category pages in the right sidebar. We were seeing server side and client side total page load times of 15-30 seconds. Server side the home page was seeing 6-15 seconds and the sub cat pages were seeing 12-25 seconds and this is all server side before the client side even gets the page. Then client side time was an additional 3-8 seconds.
I used a benchmark class and first thing I noticed was 900 queries being run. Most of them were calling $this->url->link.
I finally narrowed it down to the category data processing in these locations:
foreach ($categories as $category) in catalog/controller/module/category.php around line 33
foreach ($categories as $category in catalog/controller/common/header.php around line 107
My question is why isn't this category data cached?
I have now cached it via a vqmod. I have attached it if anyone else wants it.
My only other question remaining is I would like to know if there is a cache time setting in the admin and if not how long is data cached?
Let me know what you think of this?
Download it on Github: https://gist.github.com/weismannweb/a16 ... 89ca1d1209
EDIT: Updated to work with multi-store. Thanks to platoon for multi-store fix.
Henry Weismann
877.44.MY.WEB (877.446.9932)
We can help with your Opencart Site - Opencart Web Developer
Also check that the url_alias table has query and keyword indexed. It can provide a good speed bump though the sheer number of queries will still be a drag.
-Ryan
Your VQMod is a lifesaver! I have been trying to get the number of SQL queries on a site we're hosting (number of queries was almost 700 for the home page) and this did the trick. Server response time was over 18 seconds, and is now down to under 200 ms. Thank you, thank you, thank you! Anyone else experience slow load times and already have the product count turned off: you definitely need to try this!
Q / Daniel,
Please consider integrating something like this into the core. This was such a problem for us that we were considering not using OpenCart as a platform any longer. I no longer feel as though I have to immediately shy people away from considering the OpenCart platform.
RPH,
While I understand that the indexing can help, site owners shouldn't have to go in to PHPMyAdmin and ensure that these columns are indexed...
- Toby
"The only way to get to the top is to get off your bottom." - Fortune Cookie
read this post as well, you may find more speed-idea's:tobychin wrote:Henry, Your VQMod is a lifesaver!
http://forum.opencart.com/viewtopic.php?f=10&t=127322
Ernie
ipc.li/shop/
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
since you got no reply, let me do it:paynechia wrote:My site is running in 2 languages. The category cache doesn't work when I change to another language. Is it possible to get this cache to support multi-language site?
If you have any caching active in your 'header' Files, category-selection will possibly not change languages, I had a similar effect.
But the Content should change anyway to the other language, but it probably depends as well on what kind of caching method you use.
Ernie
openshop.li
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
It is not an issue anymore after i found your life saver posthcamelion wrote: This is not exactly a bug but it is a performance issue for stores with lots of categories.
In addition, it is also good to have multistore support which is achieved with couple small changes. Small improvement to your already perfect mod attached.
Thanks platoon for your contribution...I have updated my file in case nobody scrolls and reads further. Also paynechia let us know if you resolved your problem?
Henry Weismann
877.44.MY.WEB (877.446.9932)
We can help with your Opencart Site - Opencart Web Developer
http://forum.opencart.com/viewtopic.php ... e&start=20
Ernie
ipc.li
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
I hardcoded BOTH MOD's in Discussion, but not the Page-Cache Mod, mentioned in my last Post above, here into the Source. Testing the setup with activated Page-Cache, it 'fixed' my Page-Load Value to the (cached) Value, when cashing the Page, so, I was unable to get any more 'actual' results...
I enclosed ALL (Category-Cache related) 3 modified Source files in a ZIP. Avoid's more VqMod Server Templates to be built... (suitable OC v.1.5.6.1-5) For SUCH TASKS, I would NEVER use VqMods, just to mentioned it. I seek Speed, without compromises...
Good Luck
Ernie
ipc.li/shop/
PS: Please DO NOT ask questions, if it does not work. It's just meant for Coders, not Newbie's...
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Ernie
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
cache_category_data.xml
https://gist.github.com/weismannweb/8ad ... 8d751281b2
Ernie
---
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Users browsing this forum: No registered users and 87 guests