Is it safe to use base64 encoded images for web design, How does it compare in performance? Advantages and Disadvantages?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A base64 stream is about 33% heavier than a binary one (not taking into account the gzip compression over http that you have in place if you’re serious about performances).
If you put the base64 image directly in a page, it won’t be cached separately. So it will be heavy for all pages using this image instead of being cachable with URL as key. You may think that it helps keeping the request number low but in fact it’s useless in normal cases where users have yet the images in their cache (if you have many images, prefer css sprites to lower the number of requests).
I don’t think there is a reason to use a base64 image except for when addressing a specific technical issue, like sending an image in json, or saving only one html file – and then check you really need to use the base64 image.