H2ocubeRailsCache
Just an redis cache. Default expires_in 60.minutes.
Installation
Add this line to your application's Gemfile:
gem 'h2ocube_rails_cache'
And then execute:
$ bundle
Rails.cache support methods
keys key = '*'read key, options = {}read_multi *keyswrite key, entry, options = {}write_multi hashfetch key, options = {}, &blockdelete key, options = {}exist? key, options = {}increment key, amount = 1, options = {}decrement key, amount = 1, options = {}expire timeclearinfo
Write Options
-
expires_insuch as 5.minutes, when value is nil, will not be expired -
updated_atwill write timestamp with key_updated_at
Fetch Options
-
expires_insuch as 5.minutes, when value is nil, will not be expired -
forcetrue / false or Proc that return true / false -
updated_atwill write timestamp with key_updated_at
Task changed
rake tmp:sessions:clear # will clear redis session data too
rake tmp:cache:clear # will run Rails.clear too
ENV
-
ENV['REDIS_URL']default isredis://127.0.0.1:6379/0
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request