Skip to content

crv/custom_cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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')

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published