E
E
Eugene2017-07-26 20:37:31
WordPress
Eugene, 2017-07-26 20:37:31

Long loading of Woocommerce (2620 requests to the database on the main one), how to determine where they are called from?

Good day!
The wp + woo site has a very long loading - I began to understand, looked at profiling and query monitor, the longer I look, the less I understand.
on the main page it turns out like this
Queries by Component / Plugin: woocommerce / SELECT 2 620 / Time 4.0191
Queries by Caller / WP_Term_Query->get_terms() / SELECT 1 887 / Time 3.5411
b94ad64ab3af4fcdb3ca27c39c24d5f8.jpg
I see that there is an appeal to the terms - and where. I can’t understand, the monitor indicates that the call comes from Woo, and not from the child theme (there are quite a few finished in it)
Who faced such problems? In which direction to dig?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
WordPress WooCommerce, 2017-07-26
@maxxannik

You need to look at what elements are shown on the main page. Each element eats a certain number of requests. Optimization methods depend on what these elements are and what data they show.
You can cut off the elements one by one and see which is the most voracious.
Something like this. Without seeing the main it is difficult to say something in more detail.

E
Eugene, 2017-08-09
@redmo

Update - I dug into all this for a long time - it turned out that the get_the_terms() function is called by WooCommerce - I found such a solution on the back streets of the github https://github.com/vendidero/woocommerce-germanize... - using wp_get_post_terms instead of get_the_terms() - the first one already uses caching, and Woo, as it turned out, with a large number of taxonomies (also with a hierarchy) starts to slow down.
get_the_terms() is a hook, I plan to put it on it, but I don't quite understand what it should look like yet - if anyone has any ideas, welcome

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question