Answer the question
In order to leave comments, you need to log in
How can woocomerce be optimized?
When you open a category in the site directory, there are very long downloads, half a minute and a minute. The server was set up as best they could, and all sorts of caching, everything is ok with this. I suspect that some kind of request is written clumsily and when opening a category with 1000 positions, information is requested not for 50 products at a time (pagination is configured this way), but for the entire 1000, and given that they are variable and there are delays.
Maybe someone has examples of when that can optimize / fix it, well, or tell me why it can be so, maybe someone has an example of a normal query to display large categories?
Answer the question
In order to leave comments, you need to log in
Forgive me moderators...
when opening a category with 1000 positions, information is requested not for 50 products at a time (pagination is configured this way), but for the entire 1000
It is better to make a request (even 50 each) and load an additional amount with Ajax when scrolling or clicking on a button, you better not optimize. There is infa on the Internet on this topic ...
PS: I'm also scared to imagine what kind of animal it is)
Woocommerce makes normal queries out of the box, given pagination. Why did you have to twist his brain.
But if you still want such requests, then you need to cache the result of the request in the object cache. In addition, for the object cache to work adequately, in your case, you need Redis. It will allow you to store intermediate results of db requests between http requests. Then only the first access to the page will last for a long time.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question