Rails passenger production cache definition

Posted by mark on Stack Overflow See other posts from Stack Overflow or by mark
Published on 2010-05-09T18:03:16Z Indexed on 2010/05/10 11:34 UTC
Read the original article Hit count: 171

Filed under:
|
|
|

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. :(

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about whenever