L
L
LazarusNucleros2020-12-19 13:05:10
MySQL
LazarusNucleros, 2020-12-19 13:05:10

How to speed up WordPress+WooCommerce?

Greetings

The situation is this - there is a site based on WordPress with WooCommerce. Wp works as a headless cms, the markup is rendered by Nuxt, which interacts with WP through the rest api.

The problem is that a category or search query takes an average of 300 to 800 ms. Seoshniki take out the brain that the site is slow and it is necessary that the page load takes no more than 200 ms.

I tested the back - the main time delays occur at the stage of requesting data from the database using wp_query.

Delays grow with the increase in the number of filtering parameters.

Actually the question - is it possible to somehow optimize these queries / the database itself / WordPress in order to reduce the delays in queries to the database?

Products in the largest category - no more than 2000
Server - VPS (Ryzen 7 3700, 16 gb DDR4, 250 Gb nvme), there are practically no loads.

Thanks in advance for your replies.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
WP Panda, 2020-12-19
@wppanda5

Works as follows.
A summary table of products is added in which you store the product id and the values ​​​​of the parameters for which filtering is performed, the filter and search are rewritten to search for it.
90,000 products 3,500,000 parameters for a category in which 50k products WOFF product Filter works for 30-40 seconds, Filtering by table up to one and a half seconds

W
wdcloud, 2020-12-19
@wdcloud

make an ElasticSearch layer =) At least a cache for queries.
And only EXPLAIN will help you understand how to optimize the query itself. Perhaps the indexes are bad.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question