Hello, a month ago one of your support agents help me with the following: https://toolset.com/forums/topic/displaying-a-view/, but we have noticed that the page loads really slow, can you someone help to make this page faster.
thanks
Hello and thank you for contacting Toolset support.
From what I can gather so far, you are nesting 4 levels of views, this will for sure generate more loads on the application level(WordPress). To make it run quicker, you will need to optimize on one or several levels. At least, the server resources(CPU, Memory) and the application level.
Optimizing the application level depends very much on the data model. I understood the relationships, but I still do not know how the "Featured and Members Only" is stored? Is it stored in a custom field?
Using a caching plugin will definitely help to boost the speed of the page. We, at toolset.com, are using WP Rocket plugin, which is a premium plugin. There are also other free plugins out there that could help.
If you are comfortable with programming you might want to build your own solution for this specific page. Let me know if you want some suggestions for it.
Hi Jamal, thanks for your answer.
We are using the Ultimate Member plugin for the "Featured and Members Only" so basically if [wpv-conditional if="( $(um_content_restriction) eq '1' )"] show else not.
So from what I can understand will need to add a caching plugin as soon as we are done?
thanks
Actually, I don't think, the condition on the custom field from "Featured and Members Only", that's causing the slowness. It is rather the many levels of nested views. Each view will execute a WP_Query instance, which will execute an SQL query to the database level. Plus an SQL query from Toolset to find the related posts. At least two queries to the database.
So, the first view will execute two queries. Let's say it will return 5 geolocation.
The nested view will execute two queries for each geolocation. This will give 10 queries. Let's say they will give us 15 counties.
The nested view for municipalities will execute two queries for each county. Which will results in 30 queries.
This will result in at least 45 queries to the database.
And that is what is really causing the slowness.
A caching plugin will definitely make things faster. Caching can be implemented on several layers. These two articles seem to explain it better:
- hidden link
- hidden link
Personally, I would use a plugin that offers caching at the page level. This way the whole page with all the views will be cached. And when you update something with the tax sales and you need the page to update, just purge the page and run it once and it will be cached. Does it make sense?
This being said, I'll let you check what option will help the most. And let us know what you will do.
Thanks, we will try with some caching plugins then.