0

I am using debug-toolbar to see the number of overall queries. The problem is that when I reload the page, I see different number of overall queries, given the same code and very short period of page reload intervals. I understand this is somehow related to caching. The question is, is there any shortcut to make Django at least in the debug mode always run all the queries so that I can see the real impact of my changes in the code ?

Edgar Navasardyan
  • 4,261
  • 8
  • 58
  • 121
  • The title of your question doesn't make sense for its contents. Maybe change it to something like "Preventing caching in ORM queries" for more clicks. – coderman1234 Dec 02 '21 at 00:17

1 Answers1

0

If it is indeed caching via the caching framework, then I'd recommend changing out your caching backend with the DummyCache.

From the docs:

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
    }
}
schillingt
  • 13,493
  • 2
  • 32
  • 34