require 'fileutils' require 'glue/configuration' require 'glue/attribute' require 'glue/cache/memory' module Nitro # Adds support for caching. module Caching # Action caching. Caches a fragment, ie a page part. # Use output caching for full page caching. module Fragments # The cache used to store the fragments. setting :cache, :default => nil, :doc => 'The cache used to store the fragments' #-- # gmosx, FIXME: this is a hack, improve setting # implementation. #++ @@cache = Glue::MemoryCache.new def self.get(name, options = {}) return @@cache.get(name, options) end def self.put(name, content = nil, options = {}) @@cache.put(name, content, options) return content end private # Helper method to cache a fragment. # # === Example # # ... #