Datafeedr Support Forums  

Go Back   Datafeedr Support Forums > Current Version (V3) Forum > Questions
Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Important - The support forums are now in "read-only" mode as we transition to an alternative help desk solution. Feel free to contact us here with any of your questions or search the forums for an existing solution.
 
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 6th, 2012, 10:03 PM
dhilditch dhilditch is offline
 
Join Date: Feb 2012
Location: In my house
Posts: 108
Default Speed of Category Lists

Hi again - I'm still optimising the site. I've managed to get the custom views loading blindingly fast but now I'm having issues with the category lists. The biggest category by far on our site is 'bicycles' and on that page, I've identified the category list is what is taking the time to load.

I've created a custom function to list all the brands the user can select, and obviously I could do the same for the categories, although probably I'll generate some static HTML instead and store this but I really like the features of the category list creator - e.g. the ability to alter the code depending on current category, parent category etc.

Do you have any advice for how to improve the speed? I'm currently seeing 60 seconds coming just from the category list on this page:

http://www.fitness-saver.com/fitness...egory/cycling/

Here's the code:


<?php
if (function_exists(wpTuneMarkTime)) wpTuneMarkTime('DFR: category list'); // WPTUNER: ** Time how long this next bit takes **
?>
<h4>Categories</h4>

<div id="fscatlist">
[category.list before='<ul>' after='</ul>']

[category.if active='self']
<li class="currentcategory">
[category.name] <span class="catcount"> ([category.count] items)</span>
[category.repeat]
</li>
[/category.if]

[category.if active='child']
<li>
<a href="[category.link]" title="[category.name]">[category.name] <span class="catcount"> ([category.count] items)</span></a>
[category.repeat]
</li>
[/category.if]

[category.if active='parent']
<li>
<a href="[category.link]" title="[category.name]">[category.name] <span class="catcount"> ([category.count] items)</span></a>
</li>
[/category.if]

[category.if active='no']
<li>
<a href="[category.link]" title="[category.name]">[category.name] <span class="catcount"> ([category.count] items)</span></a>
[category.repeat]
</li>
[/category.if]

[/category.list]
</div>
  #2  
Old August 6th, 2012, 10:35 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

My suggestion is to cache this view. You have over 500 categories with 3 different levels of hierarchy. No matter how you slice it, that query will take time to load. If you turn on caching, this list will be stored as an HTML file and the list generating query will not run. The cached version of the list will be served straight out of a file. I don't see any other way to optimize such a large, nested list like this.

Eric
  #3  
Old August 7th, 2012, 07:08 AM
dhilditch dhilditch is offline
 
Join Date: Feb 2012
Location: In my house
Posts: 108
Default

Yeah but at least a minute every time is a bit excessive, for only 500 categories.

What I'm going to do is generate the static HTML and include that file here and then I'll modify this category generator to update the list using javascript. That way it should presumably load in less than 100ms.
  #4  
Old August 16th, 2012, 12:31 PM
dhilditch dhilditch is offline
 
Join Date: Feb 2012
Location: In my house
Posts: 108
Default

I discovered this was nothing to do with the category list - the slow performance was actually caused by the setting 'if this category is empty, show sub-categories'.

The code performs a cat_id in (x,y,z) type statement if this is selected and then the product list within is massive (in our case).

By unchecking this box, all product pages on our site now load fast. Maybe add a warning to that box for large sites?
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Speed up your store! Eric Tips, Tricks & Tutorials 31 October 10th, 2013 09:35 AM
Category Lists thru DFR Shortcodes kaje Questions 2 July 23rd, 2012 12:14 PM
How to speed up my site jdrom Questions 3 July 4th, 2011 10:15 AM
How do i bring category lists into pages sdasgin Questions 3 May 3rd, 2011 10:53 AM
Segmented Category Lists kaje Questions 2 April 25th, 2011 10:52 AM


All times are GMT -5. The time now is 01:19 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.