I'd like to deliver custom binary data to browser. They are actually images, but I need to deliver multiple versions of the same image + some metadata. Network performance should be achieved by using just a single GET request, and it should unpack fast in the browser. So far I could think of these solutions:
I don't care about < IE8. I think avoiding XHR is not possible in my case, but same origin policy is making it even worse as I need to load from different (sub) domain. That could be worked around though by server routing, on the other side that prevents using CDN.
That depend on data structure, but if you need do something with this data in JavaScript - there are two (three) ways to achieve this
It turned out today's (and near future - IE9) browsers have very poor support for binary data, so whatever you decide to use, it has to be encoded (encodeable?) into a Javascript String, ie. JSON+base64.
For curious minds: http://status-501.tumblr.com/post/20293218962/delivering-binary-data-to-browser
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.