Reply To: Search results are very slow

#14291
Ernest Marcinko
Ernest Marcinko
Keymaster

Hi!

I think I found the reason, although I don’t exactly know where the cause is. It looks like, that whenever the ‘POST’ method is choosen for redirection, the search gets slowed down. I’m guessing that some other plugin (or theme?) might have a function set to run on certain post requests, causing a massive delay in loading. When I switched that to the ‘GET’, it appears to have fixed the issue: https://i.imgur.com/YuxCBAk.png

I have confirmed this via testing the regular search vs ajax search override, see this video: https://www.youtube.com/watch?v=sy4v0NTPzNs&feature=youtu.be
With the regular the page loading was finished in 17 seconds vs the override in 14.7, about 2 seconds faster. This also includes loading all assets, but there is definitely a major difference when using the post method. When using the post method, this was much worse.

I have also disabled the frontend search options, as there was only a post type filter and a category filter active, but not used by default. I suspected that it might have been the cause, but apparently not. If you want, I can change that back. Since you were using the search within titles, I’ve also changed back the search to the regular engine. The reason is, that post titles are actually indexed by wordpress to some extent, so using the index table might not make too much difference there. I can revert that back as well, if you want to.

I hope this helps!

Best,
Ernest Marcinko

If you like my products, don't forget to rate them on codecanyon :)