Can browsers also cache embedded base64 images?

I was wondering if any of the modern browsers really caches embedded images - base64 strings or not?

Is there also an opportunity in the near future? based on white papers from either W3C or major browsers.

+7
html browser
source share
2 answers

I don’t think so because you are missing the Resource Identifier as the key for the cached image. With embedded images, you only have data.

In addition, the potential conditional query for embedded images must be at the level of the HTML document containing it. The entered image is just data without an additional request. But HTTP does not support something like conditional requests for pieces of data.

+4
source share

As I understand it, if a base64 string is part of an HTML document (inline), then it should be loaded and parsed as an image each time the document is downloaded - there is no way to cache document fragments. If this is a background image in an external CSS file, it can be cached with using a CSS file, but you still need to parse it with every request. I also read that base64 encoding adds about 30% of the overhead on top of image bytes, but this can be pretty much gzipping smoothed.

+3
source share

All Articles