3 ms·
Why do websites use src=data:image/png;base64
Many websites use src=data:image/png;base64 for images. It results a huge string of gibberish that renders a small image. What advantage does this have over just uploading the image and linking to it? Wouldn't the huge string of gibberish slow the site down by increasing the memory size of the page?
- yrezgui 9y agoFor some websites, the cost of making a new HTTP request to get the image is higher than inlining it in the page in terms of performance
- schoen 9y agoFor example, in terms of latency because of the network round-trips to establish the connection (or even just to send an additional HTTP request inside the existing session and wait for a reply!).