Redis and Memcache or just Redis?

后端 未结 6 1235
悲哀的现实
悲哀的现实 2020-12-12 11:01

I\'m using memcached for some caching in my Rails 3 app through the simple Rails.cache interface and now I\'d like to do some background job processing with red

6条回答
  •  佛祖请我去吃肉
    2020-12-12 11:24

    I'm the author of redis-store, there is no need to use directly Redis commands, just use the :expires_in option like this:

    ActionController::Base.cache_store = :redis_store, :expires_in => 5.minutes

    The advantage of using Redis is fastness, and with my gem, is that you already have stores for Rack::Cache, Rails.cache or I18n.

提交回复
热议问题