Hairi
Hairi

Reputation: 3733

Rails.cache.delete does not work (Dalli store)

Hi I ma new to rails and I try to delete a key from the rails cache like this:

Rails.cache.fetch('datasources_field_options')

I see a big array in the rails console Then I try to delete it like this:

 Rails.cache.delete('datasources_field_options')

This returns true this is from the console:

irb(main):004:0> Rails.cache.delete('datasources_field_options')
2019-09-26 14:45:56 +0000 1569509156754 (24618) Cache delete: datasources_field_options
=> true
irb(main):005:0>

And then I check again if it was deleted:

Rails.cache.fetch('datasources_field_options')

The cache type is ActiveSupport::Cache::DalliStore

No it wasn't. The array is still there.

What am I missing? Why cant delete the specific key from the cache?

EDIT I checked the configuration - the store is configured to use Redis on a remote host. I did a quick video to show you what I am doing.

https://youtu.be/q2WyYniacNw

Upvotes: 1

Views: 557

Answers (0)

Related Questions