Over the past two years or so, I've base64 encoded multiple types of data for the web: images, .otf
files, text, and so on. It's practical in that it serves as a makeshift asset consolidation method (with the data embedded directly in the CSS or HTML, one doesn't have to worry about a dead link), but are there any drawbacks to using this method?
The base64 encoded data is about 33% larger than the raw data.
Another effect is that you are bundling several pieces of data together into larger chunks. Sometimes this is a positive effect, sometimes negative. Requesting fewer resources is positive, but only if the resources have the same caching status. If you for example bundle an image in an HTML page, the image can't be cached separately as it has to be fetched every time the HTML page is fetched.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With