Skip to Content Skip to Search
Methods
D
Included Modules

Instance Public methods

dump(entry)

# File activesupport/lib/active_support/cache.rb, line 891
def dump(entry)
  MARK_70_UNCOMPRESSED + Marshal.dump(entry.pack)
end

dump_compressed(entry, threshold)

# File activesupport/lib/active_support/cache.rb, line 895
def dump_compressed(entry, threshold)
  payload = Marshal.dump(entry.pack)
  if payload.bytesize >= threshold
    compressed_payload = Zlib::Deflate.deflate(payload)
    if compressed_payload.bytesize < payload.bytesize
      return MARK_70_COMPRESSED + compressed_payload
    end
  end

  MARK_70_UNCOMPRESSED + payload
end