Skip Navigation

[Resolved] Views queries calling admin-ajax are taking 2-4 seconds

This thread is resolved. Here is a description of the problem and solution.

Problem:

There are calls to admin-ajax.php when I use Toolset Views Slider.

Solution:

The reason you see the admin-ajax loads are that you selected the advanced option to pre-load other pages in Toolset.

Please check the attached screenshot. If you deactivate that option those calls will not happen.

ajax

The option in question is created to mitigate the issue when the next arrow is clicked.

The amount of data is no problem an dit is more of a WordPress thing to get the response and it will take time for sure.

Now, with the option disabled, the initial load will be faster as Toolset will not add an ajax call for the other two items in the slider.

So it will be faster in the initial load. But when the arrow is clicked, for sure it will take time for the next one to be loaded.

If the option is enabled, the initial load will be more as it will try to load the next item too. But then clicking the arrow will be fast.

It will be your choice what to do with the option depending your need and which one (initial load, or fast arrow) is a priority for you.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 21 replies, has 2 voices.

Last updated by alisonC 1 year, 7 months ago.

Assisted by: Christopher Amirian.

Author
Posts
#2596199

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

It seems that I could not communicate well with the second-tier as this was the answer:

As far as I can see when visiting the front page the "Featured Prroducts List" View isn't used there, the View which appears above the footer copyright area is the View with ID = 64, which is "Pre-Footer Latest News Slider".

So I'm not clear what I should investigate.

So to be sure that we have a clear test case, would you please add a Test page and use the view that has the issue and cause the admin-ajax.php liong call and share with me the URL of that page?

Also please keep the theme to 2020 so we have that scenario which there is no theme involved and the issue is still there. That will be the ultimate scenario that seciond-tier can check and they will not debug a child theme.

Thanks.

#2597009

The view id=64 (Pre-Footer Latest News Slider) is one of the views causing the issue I'm asking about, as it uses ajax to move through slides w/out reloading the page.

I've changed the theme to 2020 and added that view to a footer widget area, so you should be able to visit any page on the site and see the issue now. Again, you'll see 2 calls to admin-ajax.php that take around 2 seconds each.

#2597383

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

Thank you. I informed and waiting for the reply.

#2599485

Christopher Amirian
Supporter

Languages: English (English )

ajax.png

Hi there,

Thank you for your patience, the second-tier support found the issue that you re experiencing. The reason you see the admin-ajax loads are that you selected the advanced option to pre-load other pages in Toolset.

Please check the attached screenshot. If you deactivate that option those calls will not happen.

Thanks.

#2599601

I see, that makes sense. 4 seconds seems a bit out of the ordinary for a query calling two blog post titles, excerpts, and a small image. Can your second-tier support offer any insight on that? (I'm seeing the same behavior across all sites w/ similar Views. I can also confirm that, if you don't pre-load the posts in this particular slider, that 2 seconds is required when the user clicks the arrow to view the next post.)

Specifically, I'm wondering where this ajax call is happening in the load order, and if allowing pre-load is causing a perceived longer load time for users.

#2599671

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

The option in question is created to mitigate the issue when the next arrow is clicked.

The amount of data is no problem an dit is more of a WordPress thing to get the response and it will take time for sure.

Now, with the option disabled, the initial load will be faster as Toolset will not add an ajax call for the other two items in the slider.

So it will be faster in the initial load. But when the arrow is clicked, for sure it will take time for the next one to be loaded.

If the option is enabled, the initial load will be more as it will try to load the next item too. But then clicking the arrow will be fast.

It will be your choice what to do with the option depending your need and which one (initial load, or fast arrow) is a priority for you.

Thanks.

#2599689

Got it. Thanks for looking into this with me!