Repository is archived
No commit activity in last 3 years
No release in over 3 years
Module for caching arbitrary objects / constructs during a request.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 2.0

Runtime

>= 1.0
 Project Readme

Rack::PerRequestCache

Simple module for caching arbitrary objects / constructs during a request.

Usage (Sinatra, Padrino, ...)

require 'rack/per_request_cache'
use Rack::PerRequestCache

Rails

# Gemfile
gem 'rack-per_request_cache', require: 'rack/per_request_cache'

# config/application.rb
config.use 'Rack::PerRequestCache'

Caveats

If Rack::PerRequestCache.clear_cache is not called, then no caching is performed. When hooked up as a middleware (see above), then the cache is enable dy default during the request lifecycle.