Skip Navigation

[Résolu] Speed of site has taken a massive hit with the addition of 200 new records

This support ticket is created Il y a 6 années et 1 mois. There's a good chance that you are reading advice that it now obsolete.

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 12 réponses, has 2 voix.

Last updated by Christian Cox Il y a 6 années et 1 mois.

Assisted by: Christian Cox.

Auteur
Publications
#617560

I am trying to: get this page to load faster. hidden link

Link to a page where the issue can be seen: hidden link

I expected to see: the page load after 10 seconds or so

Instead, I got: the page loading after an average of 50 seconds

Site worked okay until I added 200 new records. It is on a WPEngine server, so performance shouldn't be that big an issue. I have other toolset sites with more records than this that load faster.

If accessing via sftp use port 2222

#618023

I noticed a delay the first time I loaded the page but then subsequent page loads were quite fast. So then I went to webpagetest.org and ran a test. Here are the results:
hidden link
The actual page HTML consistently takes less than 1 second to load in their tests, which is strange since you and I see delayed load times. You're getting "A" ratings across the board except for image compression, which you can try to fix with better image optimization. So I'm not quite sure why the delay appears at first. Here are some thoughts:

- Rendering 330+ results cannot be expected to be very fast. There's a lot of content to download, and browsers limit the number of assets from a single domain that can be downloaded at the same time. Check the waterfall here:
hidden link
Look at all the purple, indicating images that must be downloaded. You can fix some of this by paginating results in this View, and you can also investigate using a lazy-load image plugin.

- I noticed that the HTML markup alone is around 2.4Mb on first page load. That's...large! It's no surprise the browser has trouble rendering this page, it has to parse 2.4Mb of HTML and figure out how to paint it all. If you apply a few filters, you can see that page load times are very fast:
hidden link
This page results in something like 64Kb HTML file size. So it seems to be more related to the amount of content being shown in the View, rather than Views performance.

- I'm not sure how to account for why page refreshes are so fast. Perhaps it has something to do with WPEngine's caching systems, or perhaps it has something to do with the fact that the full page has already been rendered in the browser once. Here are some tests you can try:
Turn off all plugins except Types and Views and activate a default theme like Twenty Seventeen. Refresh the search page several times to see if the performance changes much.
Deactivate WPEngine's object caching (yes, this seems counterintuitive), test again several times to see if the performance changes much.
Activate pagination for this View.

Let me know what you find.

#618424

Thanks Christian.
I tried all of this, well other than pagination. Changed to Twentyseventeen. Deactivated all plugins but types and views. There is still a pretty substantial slowdown. It has improved, but still very slow. Is there some way to get the page to open first and then have content fed into it. I think I'd be okay if that worked. The map plugin works best when all the content loads so pins show. I would love to use the map plugin with types, but it doesn't offer some of the features I need (namely KML file loading). The page loads first and then the map loads, taking an extra 7 seconds or so. I can live with that...

I've set this up on a test server (still WPEngine in a production environment, but locked down. Here's the password to see the site 84196c7cc69d
User is demo. The same credentials apply as above. Thanks again.

#618457

Is there some way to get the page to open first and then have content fed into it.
It would require custom code. There is no setting in Toolset to delay the loading of a View programmatically.

The map plugin works best when all the content loads so pins show. I would love to use the map plugin with types, but it doesn't offer some of the features I need (namely KML file loading). The page loads first and then the map loads, taking an extra 7 seconds or so. I can live with that...
It sounds like you want to show all the results on the map simultaneously, and that's why you are hesitant to implement pagination. If I'm interpreting that correctly, you can do both things with two separate Views. Both Views will use the same Query Filters, but only one will be paginated and only one will include parametric filters in the Filter Editor. The paginated View can be used to display the text-based list of results, and the unpaginated View can be used to insert the map markers. This will help page load times because less content has to be loaded in the paginated list, while also showing all the map markers together.

I've set this up on a test server (still WPEngine in a production environment, but locked down.
I didn't receive the staging URL, could you provide that in the private reply fields here?

#618468
#618494

I must be dense, but I see no way to paginate the results. I duplicated the current view I was using, but I don't see a way to create pagination within it. I did make the maps alone work and that does seem to load faster.

#618725

I see no way to paginate the results
Scroll to the top right corner of the View editor screen and click the Screen Options tab. Make sure the Filter Editor and Pagination sections are both active. Depending on how a View is initially set up, these sections may or may not be active. Then you should be able to see various Pagination options, and controls in the Filter Editor panel.

I am checking your staging site now, I'll update you shortly.

#618745

Here's the main performance issue:
hidden link
In this View of Trails, you include a View of Activities in each result. This nested query is quite heavy on the backend, and it's dramatically slowing down the performance of the main View when all 330 results are displayed. With pagination activated this performance hit isn't really noticeable.

I can think of a few options here.
- Pagination is the most practical solution.
- Second, instead of using a term field to store the image, you could consider storing the term image files in a directory with a file naming structure that matches their related terms' slugs. The icons could be named something like "activity-icon-birding.png", "activity-icon-equestrian.png", and so on for each term. Then you could eliminate the extra query required to fetch the term icon field values for each term, and build an image src URL with the slugs instead of using the types termmeta shortcode. That would save a large chunk of processing time, as this query must be repeated for each term, for each post, in sequence.
- Third, and most complex, is to set up some type of custom code solution that copies these term image URLs into a repeating custom field directly on each post. Then you can eliminate the need for the nested View altogether. This solution is outside the scope of support we provide here in the forums.

Let me know your thoughts and we can go from there.

#618759

It seems to load a lot faster with pagination. That may be the best approach. Will infinite scrolling accomplish the same thing? I've got to be gone for a few hours, but will see what I can figure out this afternoon.
Thanks again.
Joe

#618811

Yes I think infinite scrolling will accomplish a similar performance boost in that it will limit the number of queries required in a single transaction.

#619072

A couple of questions. I noticed that you added a taxonomy filter into the query. Is that what is speeding it up noticeably in addition to the pagination?

Am I remembering something that doesn't exist? I thought there was an option for infinite scrolling in the views pagination.

In terms of the map option at the top of the page--not functioning in the test site due to disabled plugins, my perfect world would be for it to display all pins at the outset--when first visiting the site, but to display only those results from the search query after an end user has made some selections (the page can completely reload or go to a new page--does not matter to me). Thanks!

#619492

A couple of questions. I noticed that you added a taxonomy filter into the query. Is that what is speeding it up noticeably in addition to the pagination?
Not sure I follow you. There are two taxonomy filters in the Query Filter section - one for Activity and another for Amenity. These are required, otherwise the taxonomy filter controls in the Filter Editor section will not have any effect on the View results. Both a Query Filter and a Filter Control are required to allow your Users to select term filters.

Am I remembering something that doesn't exist? I thought there was an option for infinite scrolling in the views pagination.
If you select either Pagination option that uses AJAX, you will be able to select an Infinite Scrolling transition effect. There are a few more options in the Advanced Settings panel, which you can toggle open with the Advanced Settings button.

display all pins at the outset--when first visiting the site, but to display only those results from the search query after an end user has made some selections
This is the default behavior of a map showing results in a filtered View. All results will be shown at first, then as filters are added only the matching results are mapped. However, since you are now paginating results in the list View, you can no longer use the list View to insert Map Markers - only the current page of results will be mapped. Instead, my suggestion is to duplicate the paginated list View, turn off pagination, and replace the Loop code with a shortcode to insert each Map Marker. Insert this second View on the search page somewhere outside the list View, and insert only the results (not the filter controls). Since you duplicated the previous list View, your new Map Marker View will respond to the same filters and URL parameters as the List View...so the results should match if any filters are applied. If you make modifications to the Query Filter or Filter Controls in one View, you should make the same changes in the other View.

#619518

Thanks for the info. I forget that wordpress doesn't always display everything unless you go to the "Screen Options" section and check it. That was my confusion about the taxonomy filters. They weren't displaying on my live website when looking at the view. So I made a mistaken assumption that you had added a filter somehow. I wasn't thinking. Same goes for the infinite scrolling. I found that after asking about it. Sorry about that. I think I have a handle on this now, but I'd like to leave it open for a day in case I have an issue with the last part of your previous instruction.

Again, thanks for the help and for being patient. I'm not normally this dense. Some non-wordpress stuff going on in life that has me distracted. Thanks again.

#619528

Of course, I will mark this ticket as pending an update from you. No need to reply right now. The ticket will remain open for 30 days.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.