You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a model where I'm including IdentityCache, let's call it Foo. I don't necessarily want this model and all of its attributes cached, but I do want its relationship cached. I have a relationship defined like:
cache_belongs_to :thing
The cache works just fine for doing things like calling foo.fetch_thing, but I noticed that when an attribute for the Foo model is updated, I get logging that looks like:
[IdentityCache] expiring=Foo expiring_id=2342 ...
and then more output saying that a delete failed for IDC:7:blob:Foo:....
So I guess my questions are:
By including the module, is Foo and its attributes being stored into cache whenever its called?
Any ideas why a delete failed would be consistently called when updating one of Foo's attributes?
Is there a way to prevent Foo from being cached (since I only want it's association to be cached)?
The text was updated successfully, but these errors were encountered:
By including the module, is Foo and its attributes being stored into cache whenever its called?
It is a read-through cache, so it won't store Foo records in the cache if they aren't fetched through identity cache. However, include IdentityCache does assume that it will be fetched, so it expires it to avoid stale reads if/when it is read from the cache. You can use include IdentityCache::WithoutPrimaryIndex in Foo to avoid these cache invalidations for this primary key index for Foo.
Any ideas why a delete failed would be consistently called when updating one of Foo's attributes?
That sounds like it might be #211. Are you using memcached_store as recommended in the README?
I have a model where I'm including
IdentityCache
, let's call itFoo
. I don't necessarily want this model and all of its attributes cached, but I do want its relationship cached. I have a relationship defined like:The cache works just fine for doing things like calling
foo.fetch_thing
, but I noticed that when an attribute for theFoo
model is updated, I get logging that looks like:and then more output saying that a
delete failed for IDC:7:blob:Foo:...
.So I guess my questions are:
Foo
and its attributes being stored into cache whenever its called?delete failed
would be consistently called when updating one ofFoo
's attributes?Foo
from being cached (since I only want it's association to be cached)?The text was updated successfully, but these errors were encountered: