Rails passenger production cache definition
- by mark
Hi
I'm having a bit of a problem with storing data in rails cache under production. What I currently have is this, though I have been trying to work this out for hours already:
#production.rb
config.cache_store = :mem_cache_store
if defined?(PhusionPassenger)
PhusionPassenger.on_event(:starting_worker_process) do |forked|
if forked
Rails.cache.instance_variable_get(:@data).reset
end
end
end
I am using a cron job to (try to) save remote data to the cache for display. It is logged as being written to the cache but reportedly null. If anyone could point me toward a decent current tutorial on the subject or offer guidance I'd be extremely grateful. This is really, really frustrating me. :(