Answers.Body: <p>Looks like SEOmatic is the culprit and not Blitz caching plugin as first thought.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-07T07:58:18.093Z
Answers.LastActivityDate: 2020-08-10T11:21:15.940Z
Answers.LastEditDate: 2020-08-10T11:21:15.940Z
Answers.UserDisplayName: Tom Byrom
Body: <p>Can anyone shed any light on this duplicated db query issue?</p>
  <p>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?</p>
  <p>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...</p>
  <p>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.</p>
  <p><strong>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??</strong></p>
  <p><a href="https://i.sstatic.net/P7YN3.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/P7YN3.png" alt="enter image description here" /></a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-08-06T20:37:13.540Z
Comments.Text: If you've stripped the template to the bare minimum, the next thing I'd do is start disabling plugins one-by-one...
Comments.UserDisplayName: James Smith
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-08-06T21:48:50.007Z
Comments.Text: 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...
Comments.UserDisplayName: Tom Byrom
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-08-07T04:12:05.290Z
Comments.Text: @TomByrom Can you add your solution as an official answer?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-08-07T07:58:36.280Z
Comments.Text: @BradBell sure just did it!
Comments.UserDisplayName: Tom Byrom
Tags: <craft3>
Title: Random duplicate DB query issue
ThreadText: # Random duplicate DB query issue
  
  (Asked by: username_0 on 2020-08-06)
  
  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](https://i.sstatic.net/P7YN3.png)](https://i.sstatic.net/P7YN3.png)
  
  **Tags:** craft3
  
  > **Comments:**
  > **username_1**: If you've stripped the template to the bare minimum, the next thing I'd do is start disabling plugins one-by-one...  
  > **username_0**: 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...  
  > **username_2**: @username_0 Can you add your solution as an official answer?  
  > **username_0**: @username_2 sure just did it!  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2020-08-07. Score: 1
  
  Looks like SEOmatic is the culprit and not Blitz caching plugin as first thought.
  
  
  ---
  
  