Fork me on GitHub

Cachetastic 1.7.0 Release

The simple, yet extremely powerful, Ruby caching framework, Cachetastic has been upgraded to 1.7.0. The big new feature of this release is the Cachetastic::Cacheable module. Including this module allows any class to become a Cache.

class Person
include Cachetastic::Cacheable
end
Person.set_into_cache(:hi, "Hello There")
Person.get_from_cache(:hi) #=> "Hello There"

Under the covers this creates a Cachetastic::Caches::Base object and proxies requests to it. This is a very simple example and belies the richness of the Cachetastic library. 

http://cachetastic-api.mackframework.com/

Features:

  • Flexible configuration. All caches have can either have their own configurations, or they can inherit from a default configuration.
  • Easy to use Adapter API. Included adapters include, LocalMemory, Memcache, DRb, File, and more. With the Adapter API being so simple, it’s easy to build your own custom adapter.
  • Flexible logging. Each cache can have it’s own loggers, or they can use the default logger.
  • JIT caching. Through Ruby’s powerful block structure, you can pass a block to a ‘get’ call and have it run if the results from the get are either ‘nil’ or ‘empty’
  • Cachetastic::Cacheable module turns any Object into a cache. It allows for any instance of that Object to cache and uncache itself.
  • And much more!

Tags: , ,

Comments are closed.