Cache which works for multi-model containers
This issue will become irrelevant if we replace our cache with Django's cache (#398 )
At the moment we don't have multiple model classes in containers but if we did it'd break our caching system. The issue is that to reset the cache on the right containers the resource will need to know which containers it's in
The initial idea is O(N) when the cache is set and O(M) when reset (where N is the number of items in the container, M the number of containers with records on the model):
- cache records are aware of which model classes are serialized in the list. The cache is made up of one store
cache[container_urlid][user]
and a secondmeta_cache[model] = [<container_urlid>, <container_urlid>, ... ]
This would also add complexity but should remove the need for Model
subclasses to optimise their caches. I'd make it overridable anyway so that the cache could be tweaked or disabled