Class | Ramaze::Cache::LRU
In: | lib/ramaze/cache/lru.rb
Parent: | Object

Cache class that uses {Ramaze::LRUHash} as a storage engine. This cache has the advantage that unlike Innate::Cache::Memory it does not leak memory over time when using the cache for sessions.

@example

     Ramaze::Cache.options.session = Ramaze::Cache::LRU
     Ramaze.setup_dependencies

@author Michael Fellinger @since 17-07-2009

### Methods

cache_clear cache_delete cache_fetch cache_setup cache_store

### Included Modules

Cache::API

### Constants

OPTIONS | = | { # expiration in seconds :expiration => nil, # maximum elements in the cache :max_count => 10000, # maximum total memory usage of the cache :max_total => nil, # maximum memory usage of an element of the cache :max_value => nil, } |  | Hash containing all the options for the cache.

### Public Instance methods

cache_clear()

Clears the entire cache.

@author Michael Fellinger @since 17-07-2009

cache_delete(*args)

Deletes a set of data from the cache

@author Michael Fellinger @since 17-07-2009 @see Innate::Cache::API#cache_delete

cache_fetch(*args)

Retrieves a set of data from the cache.

@author Michael Fellinger @since 17-07-2009 @see Innate::Cache::API#cache_fetch

cache_setup(host, user, app, name)

Prepares the cache by creating a new instance of Ramaze::LRUHash using the options set in {Ramaze::Cache::LRU::OPTIONS}.

@author Michael Fellinger @since 17-07-2009

cache_store(*args)

Stores a set of data in the cache.

@author Michael Fellinger @since 17-07-2009 @see Innate::Cache::API#cache_store

[Validate]