dimanche 1 mars 2015

It's probably more like a theoretical question but still.


It is pretty simple to use inline base64 data to pass it in image source parameter. We are doing it like that: <img src="data:image/png;base64,[base64 string]" />.


But what if the data that represented in this base64 string is gzipped? Is there a way to tell the browser about it? It can be simply done when the image is loaded from a HTTP server by adding Content-Encoding: gzip header. But is it possible with the inline method?


I couldn't find any information about this. The only solution that I see is use JavaScript to "unbase64" the data, "gunzip" it and then "base64" it again and put it to the src attribute.


But it not seem to be a good solution...


Aucun commentaire:

Enregistrer un commentaire