Categories: None [Edit]

itrigga-file_cache

https://rubygems.org/gems/itrigga-file_cache
https://github.com/itrigga/itrigga-file_cache
A simple file-system-based cache wrapper. The main method is 'with_cache( :cache_key=>'something_unique', :timeout_seconds=>(an integer) ){ (...) }' If the given cache key exists and has not timed out, it will return the cached value If not, it will * yield to the given block * store the result of the given block in the cache with the given key * return the result of the given block Required params: * :cache_key=>'some unique string that is valid in a filename' Optional params: * :timeout_seconds => (an integer - default 3600) * :cache_dir => (an absolute path - defaults to RAILS_ROOT/tmp/cache if RAILS_ROOT is defined, otherwise /tmp/cache ) Example usage: @stats_json = Itrigga::Cache::FileCache.with_cache(:cache_key=>'admin_stats.json', :timeout_seconds=>600){ /* some expensive remote API / slow IO call here /* }

Total

Ranking: 81,634 of 198,913
Downloads: 12,303

Daily

Ranking: 64,320 of 198,870
Downloads: 4

Depended by

RankDownloadsName

Depends on

RankDownloadsName
13,990,731,022bundler
291,045,770,013rspec
3,6813,727,759rcov
4,4282,349,321jeweler

Owners

#GravatarHandle
1iconitrigga