noripyt / django-cachalot

No effort, no worry, maximum performance.
http://django-cachalot.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.23k stars 151 forks source link

Tables defined in CACHALOT_UNCACHABLE_APPS are still being cached #220

Open hendrikschneider opened 2 years ago

hendrikschneider commented 2 years ago

Question

I have a structure like this:

App: AppA
class ModelA(models.Model):
   some fields ....

App: AppB
class ModelB(models.Model):
   linked_field = models.Foreignkey(ModelA, ...)

My settings are:

CACHALOT_UNCACHABLE_APPS = INSTALLED_APPS

CACHALOT_ONLY_CACHABLE_APPS = [
    "AppA"
]

Why are my setting likes this? I've noticed that some tables are being cached of apps that were not defined to be cached. That's why I am exluding all and whitelist them later on. When I only defined CACHALOT_ONLY_CACHABLE_APPS without setting CACHALOT_UNCACHABLE_APPS even more apps were cached even though they should't be (e.g celery beats table)

When using my application, I've noticed in the debug toolbar that also the tables of AppB are being cached even though they should not. I am also not access ModelB.

Is this behaviour as expected?

What have you tried so far?