I Use This!
Analyzed 2 days ago. based on code collected 2 days ago.

Project Summary

Easycache lets you easily cache arbitrary data in your Ruby on Rails applications. The plugin makes use of Rails' built-in fragment caching mechanism to store and retrieve any serializable data. This is especially useful when you want to store data from slow/external sources like LDAP, Web Services, or REXML functions, for which Rails does not currently offer an integrated caching mechanism.

INSTALLATIONFrom the command line, cd into your Rails application's root directory and run:

ruby script/plugin install git://github.com/zuk/rails-easycache.git

EXAMPLESOnce you've installed the plugin, you should be able to do something like this anywhere in your application (in controllers, helpers, etc.):

foo = ['alpha', 'beta', 'delta', 'gamma']

# store foo in the cache under the keyname 'greek'
Easycache.write('greek', foo)

# retrieve the data stored under keyname 'greek'
foo = Easycache.read('greek')

# delete the data stored under keyname 'greek'
Easycache.delete('greek')In practice, you will probably want to use caching transparently, so that data is pulled from the cache if available, or from the original source otherwise. For example, say you have a function ldap_query() that does a slow LDAP query to retrieve some data. Just wrap this function call inside an Easycache.cache block, like this:

my_data = Easycache.cache('ldap_data') do
endThe first time the block runs, it will execute ldap_query(), store its return value in the cache under the key 'ldap_data', and return it for assignment into your my_data variable. The next time it's run, the return value will come from the cache, so the block won't need to be executed.

TIME-BASED EXPIRYThe write() and cache() methods both take an optional options hash. Currently the only supported option is :expiry, which will force the cached value to expire after the given number of seconds. For example:

Easycache.write('greek', ['alpha', 'beta'], :expiry => 60)or

greek = Easycache.cache('greek', :expiry => 60) do
['alpha', 'beta']
endThe above will expire the 'greek' value after 60 seconds. In Rails applications you can use active_support's time extensions to specify the expiry period. For example:

Easycache.write('greek', ['alpha', 'beta'], :expiry => 24.hours)


cache plugin rails ruby

In a Nutshell, easycache...

MIT License

Commercial Use




Private Use


Hold Liable


Include Copyright

Include License

These details are provided for information only. No information here is legal advice and should not be used as such.

Project Security

Vulnerabilities per Version ( last 10 releases )

There are no reported vulnerabilities

Project Vulnerability Report

Security Confidence Index

Poor security track-record
Favorable security track-record

Vulnerability Exposure Index

Many reported vulnerabilities
Few reported vulnerabilities

Did You Know...

  • ...
    there are over 3,000 projects on the Open Hub with security vulnerabilities reported against them
  • ...
    learn about Open Hub updates and features on the Open Hub blog
  • ...
    use of OSS increased in 65% of companies in 2016
  • ...
    data presented on the Open Hub is available through our API
About Project Security

30 Day Summary

Jun 30 2021 — Jul 30 2021

12 Month Summary

Jul 30 2020 — Jul 30 2021


Be the first to rate this project
Click to add your rating
Review this Project!