4 ms·
I'm surprised this isn't more web focused, i.e. a NodeJS library which encodes an image as a BASE64 data URL which any browser can render immediately while the
by marcusjt 7y ago
I'm surprised this isn't more web focused, i.e. a NodeJS library which encodes an image as a BASE64 data URL which any browser can render immediately while the real image lazy loads
- DagAgren 7y agoIt's a lot more efficient to do it once, and store it. Also, it's really simple! Go ahead and create a library for it! The algorithm is tiny, and easily ported, so it's quite fun.
- nojvek 7y ago100% agreed. A base64 encode would be a lot more browser friendly. Something like `background-image: url('data:image/jpeg;base64,....')` means you only need the encoder, the browser would decode without any js being needed (which would block initial page render)