Advantages and disadvantages of using base64 encoded images(使用 base64 编码图像的优缺点)
问题描述
我正在考虑为我正在开发的网站使用 base64 编码图像以优化加载时间.
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.
推荐答案
它只对非常小的图像有用.Base64 编码文件比原始文件大.优点在于不必打开另一个连接并向服务器发出 HTTP 请求以获取图像.这种优势很快就会消失,因此只有大量非常小的单个图像才有优势.
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 编码图像的优缺点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用 base64 编码图像的优缺点


- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
- 400或500级别的HTTP响应 2022-01-01
- addEventListener 在 IE 11 中不起作用 2022-01-01
- 失败的 Canvas 360 jquery 插件 2022-01-01
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- Flexslider 箭头未正确显示 2022-01-01
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- Fetch API 如何获取响应体? 2022-01-01