Suor / django-cacheops

A slick ORM cache with automatic granular event-driven invalidation.
BSD 3-Clause "New" or "Revised" License
2.12k stars 227 forks source link

Django Admin not invalidating cache on save #469

Closed northkode closed 6 days ago

northkode commented 11 months ago

we have a pretty basic config:

CACHEOPS = {
    'auth.user': {'ops': 'get', 'timeout': 60 * 15},
    'auth.*': {'ops': ('fetch', 'get')},
    'auth.permission': {'ops': 'all'},
    'license.*': {'ops': 'all'},
    'users.*': {'ops': 'all'},
    'assessments.*': {'ops': 'all'},
    'trainingplans.*': {'ops': 'all'},
    'questionnaires.*': {'ops': 'all'},
    'workouts.*': {'ops': 'all'},
    'shop.*': {'ops': 'all'},
    'system.*': {'ops': 'all'},
    '*.*': {},
}

and everytime we update something in the admin, the object is still cached via API calls. Is there something I'm missing here?

Suor commented 11 months ago

That's something new. The only idea I have is that cacheops is not setup in admin or is disabled there somehow. Otherwise your will need to debug it.

northkode commented 11 months ago

i'm using out of the box setup based on the readme, yet it says that it should invalidate based on signals and the django admin does signals for saving and editing models.

Not sure what you mean, debug it.. we literally just did a pip install and added it to our configs

Suor commented 11 months ago

By debug I mean, go other how it works: do signals fire? are cacheops handlers called? are redis queries executed? I.e. what is happening at every separate step.

Suor commented 9 months ago

Ok, another thing that comes to mind maybe admin is issuing mass updates or somehow else hit the CAVEATS?