使用base64编码图像的优点和缺点 [英] Advantages and disadvantages of using base64 encoded images

查看:1184
本文介绍了使用base64编码图像的优点和缺点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



不管怎么说,在我开始之前,我想知道:什么是什么?这样做的优点和缺点是什么?



目前,我没有看到任何缺点,但我也注意到这不是一种经常使用的技术,



在googleing这个主题之后,我没有发现任何明确的内容,所以我决定在这里问问。

解决方案

它仅适用于非常小的图像。 Base64编码文件比原始文件大。其优势在于不必打开另一个连接并向服务器发送图像的HTTP请求。这种好处很快就会消失,所以只有大量非常小的个人图像才有优势。

I am thinking of using base64 encoded images for a site I am working on to optimize the load time.

Anyways, before I start, I was wondering: what are the advantages and disadvantages of doing this?

At the moment, I don't see any disadvantage but also I noticed that it is not a technique used very often and that makes me wonder if I didn't miss something.

After googleing the subject I didn't find anything clear so I decided to ask here.

解决方案

It's only useful for very tiny images. Base64 encoded files are larger than the original. The advantage lies in not having to open another connection and make a HTTP request to the server for the image. This benefit is lost very quickly so there's only an advantage for large numbers of very tiny individual images.

这篇关于使用base64编码图像的优点和缺点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆