I am unable to see anything in the cache from the console in either development or production.
For development, I have turned on caching and set it to memory store, in production I use the dalli gem and Memcachier on Heroku.
Every key I try comes back nil.
However, in development, if I put in a binding.pry
before somewhere I'm doing a Rails.cache.fetch
, I can do a Rails.cache.read
there and see something returning, and indeed if so, execution does not go in to the fetch
's block.
From the console, if I try Rails.cache.read
ing the same key that just returned a cached result in the pry
breakpoint console, I get nothing. It seems like the console has a separate cache, as if from the console I do Rails.cache.write("whatever", "blah")
and Rails.cache.read("whatever")
, I get "blah" in return, as expected.
Is there a way to experiment with the cache for a running server from the console?