sorentwo / readthis

:newspaper: Pooled active support compliant caching with redis
MIT License
504 stars 40 forks source link

Using readthis as ActiveRecord::Cache::Store with hiredis #7

Closed jakoss closed 9 years ago

jakoss commented 9 years ago

Hi I'd love to use redis as cache with hiredis driver, but i'm not sure how to use it here.

Would this work?

config.cache_store = :readthis_store, ENV.fetch('REDIS_URL'), {
  expires_in: 60.minutes,
  namespace: 'cache',
  driver: :hiredis
}
dblandin commented 9 years ago

Hey @Nekromancer,

The latest released version of Readthis, v0.6.2, is preconfigured to use hiredis and specifies the hiredis gem as a dependency so Bundler should install it alongside the readthis gem.

On master and in the next released version of Readthis, v0.7.0, you may specify another driver via the driver configuration option, just as you have shown above. Based on what I see on the master branch now, Readthis will default to :hiredis but you'll have to explicitly include the hiredis gem to your project's Gemfile.

jakoss commented 9 years ago

That's great, thanks for help ;)

dblandin commented 9 years ago

@Nekromancer No problem!

Thanks for the issue and let us know if you have any other questions. :+1: