https://github.com/optum/legion-cache
A Wrapper class for the LegionIO framework to interface with both Memcached and Redis for caching purposes
https://github.com/optum/legion-cache
cache legionio memcached redis ruby
Last synced: about 2 months ago
JSON representation
A Wrapper class for the LegionIO framework to interface with both Memcached and Redis for caching purposes
- Host: GitHub
- URL: https://github.com/optum/legion-cache
- Owner: Optum
- License: apache-2.0
- Created: 2021-06-01T22:07:30.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-09T11:39:44.000Z (about 5 years ago)
- Last Synced: 2025-03-08T13:36:54.516Z (over 1 year ago)
- Topics: cache, legionio, memcached, redis, ruby
- Language: Ruby
- Homepage:
- Size: 20.5 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
Legion::Cache
=====
Legion::Cache is a wrapper class to handle requests to the caching tier. It supports both memcached and redis
Supported Ruby versions and implementations
------------------------------------------------
Legion::Json should work identically on:
* JRuby 9.2+
* Ruby 2.4+
Installation and Usage
------------------------
You can verify your installation using this piece of code:
```bash
gem install legion-cache
```
```ruby
require 'legion/cache'
Legion::Cache.setup
Legion::Cache.connected? # => true
Legion::Cache.set('foobar', 'testing', ttl: 10)
Legion::Cache.get('foobar') # => 'testing'
sleep(11)
Legion::Cache.get('foobar') # => nil
```
Settings
----------
```json
{
"driver": "dalli",
"servers": [
"127.0.0.1:11211"
],
"connected": false,
"enabled": true,
"namespace": "legion",
"compress": false,
"cache_nils": false,
"pool_size": 10,
"timeout": 10,
"expires_in": 0
}
```
Authors
----------
* [Matthew Iverson](https://github.com/Esity) - current maintainer