The project is in a healthy, maintained state
A simple redis cache
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
 Project Readme

LightRedisCache

This gem is a very basic implementation of a Ruby client for Redis.

It is not supposed to be used in production, the aim of this gem is to understand of Redis work and how to implement a Redis client to cache data.

It creates a TCP socket between your app and your Redis server. A few methods let you communicate with your Redis server using a protocol called RESP (REdis Serialization Protocol). See https://redis.io/topics/protocol

In a Rails app, just use LightRedisCache instead of Rails.cache.

Installation

Add this line to your application's Gemfile:

gem 'light_redis_cache'

And then execute:

$ bundle

Or install it yourself as:

$ gem install light_redis_cache

Configuration

Add this block, with the configuration of your Redis server, in your code :

LightRedisCache.configure do |config|
  config.hostname = 'MY_HOSTNAME' # default: 'localhost'
  config.port = 'MY_PORT' # default: '6379'
end

If you have a Rails app, it should go in config/initializers/light_redis_cache.rb

Development

After checking out the repo, run bin/setup to install dependencies.

Set the config of the local redis server you want to use for the tests in spec/local_redis_server.rb.

Then, run rake spec to run the tests.