I Use This!
Analyzed about 13 hours ago. based on code collected about 13 hours 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...

  • ...
    65% of companies leverage OSS to speed application development in 2016
  • ...
    you can embed statistics from Open Hub on your site
  • ...
    there are over 3,000 projects on the Open Hub with security vulnerabilities reported against them
  • ...
    compare projects before you chose one to use
About Project Security

30 Day Summary

Jan 7 2023 — Feb 6 2023

12 Month Summary

Feb 6 2022 — Feb 6 2023


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