Suor / django-cacheops

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

Multi-table inheritance not supported #31

Open Suor opened 11 years ago

Suor commented 11 years ago

More precisely, automatic event-based doesn't work properly for it. There are actually two different cases:

  1. When SubModel instance is added, changed or deleted none of BaseModel queries invalidated.
  2. When BaseModel instance changed or deleted none of queries for any submodels are invalidated.
Suor commented 11 years ago

Postponed multi-table inheritance support. Some champion can implement it - and I'll thankfully merge. I will probably reconsider implementing it if this feature will gain sufficient interest one day.

Gillingham commented 10 years ago

Is just adding a save() method to the child models that calls invalidate_model on the parent a sanish way to get around this for now?

pySilver commented 4 years ago

@Suor sorry for digging into such an old ticket. Is there anything that can be done to mitigate this issue? I'm using Wagtail CMS which uses concepts of Page (base model with few fields) and SomeConcretePage (extends Page with additional fields using multi-table inheritance).

The problem im observing is that while caching works fine, invalidation is not. For time being I'm thinking either not to use it for this kind of models or doing some custom aggressive cache invalidation.

Suor commented 4 years ago

I guess you can make signal handlers doing one or several invalidate_obj() calls. A concrete use case might be simple enough.

pySilver commented 4 years ago

I saw pending PR with some code samples, will try that! thanks!