instiki/vendor/rails/activesupport/lib/active_support/cache/compressed_mem_cache_store.rb
Jacques Distler 5292899c9a Rails 2.1 RC1
Updated Instiki to Rails 2.1 RC1 (aka 2.0.991).
2008-05-17 23:22:34 -05:00

16 lines
437 B
Ruby

module ActiveSupport
module Cache
class CompressedMemCacheStore < MemCacheStore
def read(name, options = {})
if value = super(name, options.merge(:raw => true))
Marshal.load(ActiveSupport::Gzip.decompress(value))
end
end
def write(name, value, options = {})
super(name, ActiveSupport::Gzip.compress(Marshal.dump(value)), options.merge(:raw => true))
end
end
end
end