0.0
No commit activity in last 3 years
No release in over 3 years
A wrapper over Rails cache to provide request and session cache.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 4.0.10
 Project Readme

custom_cache

Gem Version

A wrapper over Rails cache to provide request and session cache

Installation

Add this line to your application's Gemfile:

gem 'custom_cache'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install custom_cache

Usage

The request_cache can be used to share information over the request between controller, models etc without re-fetching it

Rails.request_cache.write('current_product_id', 'd4f30996-4dba-4805-8114-6b35d1272858')
Rails.request_cache.read('current_product_id')

The session_cache can be used to share information across the requests between controller, models etc without re-fetching it

Rails.session_cache.write('capabilities', ['REPORTS_VIEW', 'PRODUCT_CRUD'])
Rails.session_cache.read('capabilities')