Shopify/rails_cache_adapters — pull request #1 by dylanahsmith (2013-05-31 19:18:17+00:00)
Title: Avoid marshal dumping raw data or compressed string.

@camilo & @csfrancis for review

## Problem

The cache entry is normally marshal dumped to serialize the object, but the `:raw => true` option should avoid this `Marshal.dump` so that a string can be cached directly.

After this we compress the data using Snappy, then we have a string we can write to memcache. However, instead passed `true` to the `marshal` parameter in the `@data.set` method call, which does another unnecessary `Marshal.dump` of the compressed string.

## Solution

This pull request gets rid of the above mentioned unnecessary marshalling.

This PR also overrides read_entry in order to pass `false` for the marshal parameter of `@data.get` to avoid an unnecessary `Marshal.load`. The `rescue Snappy::Error` is temporarily needed until we flush the cache.

We aren't currently using the `:raw => true` option when writing to the cache, so no transitional code is needed for that purpose.