plataformatec/faraday-http-cache — pull request #17 by jimjh (2013-07-10 00:30:40+00:00)
Title: Add support for binary responses.

Consider the following use case:

```ruby
client = Faraday.new do |builder|
builder.use :http_cache
builder.adapter Faraday.default_adapter
end
client.get('http://imgs.xkcd.com/comics/im_sorry.png')
client.get('http://imgs.xkcd.com/comics/im_sorry.png')
```

MultiJson will run into trouble deserializing the cached image. Marshal does a better job, and is probably faster.

```ruby
n = 50000
Benchmark.bm do |x|
x.report { for i in 1..n; MultiJson.dump data; end }
x.report { for i in 1..n; Marshal.dump data; end }
end
```

user system total real
0.610000 0.020000 0.630000 ( 0.632136)
0.140000 0.010000 0.150000 ( 0.147296)