The instance cache should have a lifetime so references to model instances get removed after a certain time to avoid memory leeks.
Maybe attach a timeout to each newly created model instance. After this timeout remove the reference.
If the model instance gets updated before the timeout, renew the timeout.
The instance cache should have a lifetime so references to model instances get removed after a certain time to avoid memory leeks.
Maybe attach a timeout to each newly created model instance. After this timeout remove the reference. If the model instance gets updated before the timeout, renew the timeout.