Closed pieterjandebruyne closed 4 years ago
So without greater context, I can't explain the duplicated queries, other than to say they don't seem to be coming from SEOmatic.
I can tell you about load times, and that in local dev, SEOmatic sets its caches to only 30 seconds, whereas in production, you'll get a performant page. Check out this article for details:
https://nystudio107.com/blog/tips-for-using-seomatic-effectively#caching-and-cache-busting
After reading the above, if you still have issues with SEOmatic's performance in production, I can re-open the issue.
But this is very likely something you're experiencing with devMode
on or in a local dev environment.
Hi, @khalwat I believe this is still a large issue. I can see it happening in all my most recent sites. Depending on the complexity the queries get larger and larger.
Locally I created vanilla install with just Craft and SEOmatic and went through some troubleshooting for you to see if this is an issue or not worth investigating. It's making it very hard at the moment to do any performance work as I can't get rid of these duplicate queries.
Here is a video with my walkthrough.
https://share.getcloudapp.com/rRul6rdr
Happy to bundle up the vanilla site for you if you want them
@john-henry in local dev, the SEOmatic caches are only 30 seconds. Turn devMode off to see what it's like with caches in place
Just noting that I had a test with devmode off in my video above.
Here is a second video with vanilla after adding a few items to SEOmatic itself like some images. Similar to @pieter-janDB above
https://share.getcloudapp.com/OAuBbqXP
I'm trying to find some time to show you some production sites but even with this vanilla install it seems like a lot of overhead to me before we even get to the caching layers.
Hi @khalwat I'm also seeing what @john-henry is seeing - I watched his video and yep, seems very familiar. Has this been addressed at all?
@MadMikeyB I'm not aware of anything that needs to be address here?
Yii2 has a built in query cache, so if the same query is executed more than once on a request, there is very little overhead involved.
Just seeing that duplicate queries exist is not necessarily a problem. What you should be concerned with is the overload load time, not duplicate queries.
Local dev with its 30 second caches will be slower, due to the number of cache misses. SEOmatic is doing a lot -- if you wrote Twig code to pull from a variety of fields, assets, etc. you would end up with similar overhead. SEOmatic's two-level cache should make this a non-issue in production.
Everything in @john-henry 's video looks normal to me, I believe we hashed this out on Discord IIRC.
To be clear: simply seeing duplicate queries is not necessarily a problem.
Hi,
I activated Seomatic on my e-commerce craft 3 website.
The following queries are from a commerce product detail page:
If I use the default image for facebook sharing, it gives 9 duplicated queries trying to fetch that image:
x9
x9
Using an image from a field (In the general Content SEO settings) shows 2queries that are duplicated 18 times (in the craft admin debug bar)
The 2 queries are:
x18
x18
I can not pinpoint why these queries get executed 18 times, enabling seomatic makes the load time go from 500ms to 2500ms..
Could you guys explain why these queries get duplicated or is this a bug?
Thanks for having a look, Pieter-Jan
Craft CMS 3.3.20.1 SEOmatic 3.2.43