Is sending data as application/octet-stream any more efficient than sending it as a JSON-encoded byte array?

I have a web application that allows a client to request several image thumbnails at once. The response is currently sent as a JSON-encoded list of objects where each object includes the (encoded) image data. (I'm using JSON.NET; it looks like it's encoding the image data as base64 strings).

If I change my application such that the image data is sent separately from the JSON object, as "binary" (application/octet-stream) content, will this be more efficient?

Or put more simply, is application/octet stream a more compact encoding than base64?

Also, how does this differ from image/jpeg?


OK, so application/octet-stream is essentially binary, which is - of course - more efficient than base64. Something like 30% more efficient in terms of space, and removes the need to encode/decode.

Need Your Help

Turning off logging output in activerecord sqlite3 adaptor in ruby

ruby activerecord sqlite3

I use the ActiveRecord-gem for accessing a sqlite3-database, all without Rails. I use it like this: