I am using:
Rails 4.1.0rc2
Heroku
gem 'memcachier'
gem 'dalli'
If I use caching from the console, it works:
irb(main):010:0> Rails.cache.write("foo", "bar")
=> 1297036692682702848
irb(main):011:0> Rails.cache.read("foo")
=> "bar"
But if I set the cache using Rails.cache.fetch in the application, and attempt to read via the console, I get this.
Rails.cache.read([School, "California", [], School.where(state: "California").all.map(&:updated_at).max, "city_filters"])
Dalli::Server#connect mc3.dev.ec2.memcachier.com:11211
Dalli/SASL authenticating as 451265
Dalli/SASL authenticating as 451265
Dalli/SASL: 451265
Dalli/SASL: 451265
=> [{:type=>"city", :value=>"San Francisco", :count=>11, :current=>false}]
But when I run this in the app, it does a new search each time.
Completed 200 OK in 8481ms (Views: 1151.4ms | ActiveRecord: 246.6ms)
Caching works locally (it's not a full cache).
Completed 200 OK in 655ms (Views: 244.5ms | ActiveRecord: 74.5ms)
How can I get memcached/dalli working? I had this working in a different app; seems like the same set up to me.