I am trying to interact with the cache store in a Rails app using Dalli. I am doing just fragment caching and have set up my dev config like this:
#config.action_controller.perform_caching = true
config.cache_store = :dalli_store
So that it isn't caching everything. The fragment I'm interested in caching is like this:
<% cache("home_main", :expires_in => 1.minute) do %>
<div class='tabbed-content content-1'>
<%=render :partial => 'shared/launch-main', :locals => { :locations => @locations } %>
</div>
<% end %>
When I go in and run
ruby-1.9.2-p290 :019 > Rails.cache.stats
ruby-1.9.2-p290 :019 > y _
I get:
conn_yields: '0'
bytes: '17153'
curr_items: '1'
total_items: '5'
evictions: '0'
reclaimed: '0'
Now is there a way to get back that fragement cache? Or to see it? I tried:
Rails.cache.fetch('home_main')
but that isn't working. Is there a way for me to see a list of cache keys?
thx
edit #1
for @cpuguy83 - so clearly going to DB with 196ms :-(
Read fragment views/home_main (2.4ms)
Rendered index/homepage_launch_main.html.erb (2.8ms)
Completed 200 OK in 1623ms (Views: 11.5ms | ActiveRecord: 195.8ms)