You are here:  » Load time question


Load time question

Submitted by TWDesigns on Thu, 2018-03-22 12:22 in

Hey David,

I was wondering how to better my load time using the script vs the plugin. I noticed if I am using WP Plugin the same search results load twice as fast. Not sure how the calls are different but was wondering if there's a better practice I could be using to get faster DB search results.

Thanks,
Tommy

Submitted by support on Thu, 2018-03-22 16:17

Hi Tommy,

That's strange - it's normally the other way round! What I was wondering though, is whether you have added additional custom filters to the standalone installation that are not in effect on the WordPress installation as that would explain a page generation time difference. If that's not the case let me know and I'll check it out further with you. If you could post example standalone / WordPress links to compare that would help (I'll remove before publishing your reply...)

Cheers,
David.
--
PriceTapestry.com

Submitted by TWDesigns on Thu, 2018-03-22 20:54

Hi David,

Here are the two examples and the only filters I have in place is a 2 category drop regs and a replace. I assume these only take place during an initial import.

WP Side
{link saved}

PT Side
{link saved}

Thanks in advance!

Tommy

Submitted by support on Fri, 2018-03-23 10:54

Hi Tommy,

I just tried the links - WordPress first, and then standalone was faster for me - so I'm wondering if this is actually down to the testing sequence with the query being cached by the database - meaning for the same query (e.g. specific category), the second test would always be the faster...

Let me know if you're still not sure of course and I'll check it out further with you...

Cheers,
David.
--
PriceTapestry.com

Submitted by TWDesigns on Sun, 2018-03-25 19:26

I didn't think about the database cache query. It still seems sluggish to me vs the other. I guess my next question will be is there any way to increase load times. Is it possible to only query X products until the next page of items is requested somehow? I'm no programmer so I'm fishing in the dark here.

I have roughly half a million items which I assume is why the delay. I'm still trying to figure out the best practices for product and category mapping, would that help in any way?

Thanks!

Submitted by support on Mon, 2018-03-26 08:55

Hi Tommy,

For a very large database querying the filter drop-downs would be a significant component of the overall page load time. An easy mod for the indexed searches (merchant / category / brand) is not to show filters initially but instead just the "Filter These Results" button which when clicked leads to the non-rewrite version of the page with filters displayed.

To try this, edit html/searchfilters.php and add the following code to the very top of the script (before the existing opening PHP tag):

<?php if ($rewrite): ?>
<?php
  print "<div class='row pt_sf'>";
  print "<div class='small-12 columns'>";
  print "<form method='GET' action='".$config_baseHREF."search.php'>";
  print "<input type='hidden' name='q' value='".htmlspecialchars($q,ENT_QUOTES,$config_charset)."' />";
  print "<div class='small-12 medium-3 columns' style='text-align:left;float:left;'>";
  print "<button type='submit' class='button tiny pt_sf_submit'>".translate("Filter These Results")."</button>";
  print "</form>";
  print "</div>";
  print "</div>";
?>
<?php else: ?>

And then add the following code to the very bottom of the script (after the existing closing PHP tag):

<?php endif; ?>

Cheers,
David.
--
PriceTapestry.com