instiki/vendor/rails/activesupport/lib/active_support/cache/compressed_mem_cache_store.rb
Jacques Distler d4f97345db Rails 2.1.1
Among other things, a security fix.
2008-09-07 00:54:05 -05:00

16 lines
455 B
Ruby

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