-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document how to expire cache manually #445
Comments
When a record is saved,
If you are trying to load the record (e.g. because the raw SQL update is for performance reasons) then there is an |
@dylanahsmith thank you. so i used some workaround because method expire_cache if private 👯♂ if variable "target" is invalid cache, cache_key = target.primary_cache_index_key |
I find there is IdentityCache.cache.delete(MyModel.rails_cache_key(my_id)) |
If you are on the latest version of the code, then |
Oh right, I meant to leave this open to remember to document this. Updated the title accordingly |
sometimes i want to expire(remove) cache manually. for example,
in rails console:
val = ValueModel.fetch(1)
(and log shows like that.. SQL: select * from value_model where id = 1 limit 1)
and this record is updated at other environment(ex: raw sql from DBMS)
then, use statement again in rails console.
val2 = ValueModel.fetch(1)
and then rails console shows, cache hit, and nothing changed.
in this situation, can i expire this cache manually?
The text was updated successfully, but these errors were encountered: