1

Can anyone shed any light on this duplicated db query issue?

I've noticed when going through my site with the debug toolbar on, sometimes when I click a page or entry there is often double the amount of DB queries being run than normal? And when I look at the details it's often just every query duplicated?

If I refresh the page the proper amount of queries are run and TTFB is exactly half. It's worth noting regardless of whether 'disable cache' is set in Chrome Dev tools this happens. If I navigate to another area of the site and come back, it's hit and miss whether the duplicated queries are run. On manually refreshing the same page the correct number of queries always run...

What do you think would be causing this? I've eager loaded everything thing that I can on each template and performance is generally very good but random duplicate query issue is baffling me.

Edit: Seems to be only happening on my main entry template. I've removed all the code from this template to only leave in basic scripts and it still spits out 100 db queries and says 50% of them are duplicate. But in the template there are no queries to even be made??

enter image description here

4
  • If you've stripped the template to the bare minimum, the next thing I'd do is start disabling plugins one-by-one... Commented Aug 6, 2020 at 20:37
  • Thanks - that has done it, looks like Blitz caching plugin - even though caching wasn't enabled in the plugin settings disabling the plugin fixed it. Re-enabling the plugin and it looks like it's sorted itself out...
    – Tom Byrom
    Commented Aug 6, 2020 at 21:48
  • @TomByrom Can you add your solution as an official answer?
    – Brad Bell
    Commented Aug 7, 2020 at 4:12
  • @BradBell sure just did it!
    – Tom Byrom
    Commented Aug 7, 2020 at 7:58

1 Answer 1

1

Looks like SEOmatic is the culprit and not Blitz caching plugin as first thought.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.