Class Merb::Cache::FileStore
In: lib/merb-cache/stores/fundamental/file_store.rb
Parent: AbstractStore

Cache store that uses files. Usually this is good for fragment and page caching but not object caching.

By default cached files are stored in tmp/cache under Merb.root directory. To use other location pass :dir option to constructor.

File caching does not support expiration time.

Methods

create_path   delete   delete_all   exists?   fetch   new   pathify   read   read_file   writable?   write   write_file  

Attributes

dir  [RW] 

Public Class methods

Creates directory for cached files unless it exists.

Public Instance methods

Deletes cached template by key using FileUtils#rm.

Checks if cached template with given key exists.

Fetches cached data by key if it exists. If it does not, uses passed block to get new cached value and writes it using given key.

Reads cached template from disk if it exists.

File caching does not support expiration time.

Writes cached template to disk, creating cache directory if it does not exist.

Protected Instance methods

Reads file content. Access to the file uses file locking.

Writes file content. Access to the file uses file locking.

[Validate]