soarli

初次接触Base64记
之前看到过一些图片,链接长这个样子:一直好奇到底是怎么回事,是本地缓存还是啥,今天带着疑惑和猜测在一个偶然的机会中...
扫描右侧二维码阅读全文
11
2020/06

初次接触Base64记

之前看到过一些图片,链接长这个样子:

一直好奇到底是怎么回事,是本地缓存还是啥,今天带着疑惑和猜测在一个偶然的机会中这个问题迎刃而解!

看下面这张图片:

它的链接其实长这个样子:

data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAGnAacDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD6pooooAKKKKACiiigAooooAKKKO1ABRSbh6ik3AetADqKbu+tJuI9KAH0UzcfWkyfU0ASUVH9c/nSUWAlyPWkyPao6KAJMj1oyPWo6KAJMj1oyPWo6KAJcj1oFRUUAS0VEOOmaXPuaAJKKj3HvilDfWgB9FICD0xS0AFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAAoFApCwFAC0hYCo8k96KFqA/d7Um4+1NooELk+9J9TRRQO4UUUUCCiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAClBx3NJRQA8N60oIPSo6KBkv1oqNWPfpTwQehoAWiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAKFvqdlO+yC6hdugAbOfpV7IxzXmGB3xx/n8DXV+Fr6S5hkt52LvFgqxP3lPr649+ahSuYU63NozoS2enSkooqzYKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAHK3HNPHtUVKDjpQMkopFYGloAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAPL6fBNLA++CR42/vKffv+P1pnSisE7Hmp21Oy8O6q1/E8UwH2iPBJA+8D3Hoa2a5DwcjHUJnUHYse0n3J9fwrr61i20d1KTcdQoooqiwooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooABTlPrTaKAJRRTFbsfwp4oGFFFFABRRRQAlFJkcjIp2aAuFFFFABRRRQAUUUUAcYPDF3/AM9rf9adH4XuC3z3MKr32qSf14zXWUUrIxVGJU06yhsIPLgBxnJYnJJ9T78VbooprsaJWVgooooGFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAU5WxwabRQA/ANH8qRTVa9uUtYTJJzzgD1P+RR6g2lqWu3tXO6tfyPO8UTFY14JB+8f5/5PaopNVunOQyoM9AOn4nr+lU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KKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAlooooGAphXuKfQKAIqKkK56dajx60CCiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAJaKKKBhRRRQAUhAxzRRQAwjFJRRSQMKKKKYgooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooA//2Q==

它的实现实际上就是通过计算机内部既定的一种编/解码规则对图像进行一种文本化操作,说白了就是可以将一张图片数据编码成一串字符串,使用该字符串代替图像地址url

我尝试转了几张不同格式的图片,它们毫无例外地都变大了,明显是用html文本资源换取图像本身资源嘛。

能想到的一个应用场景就是对于纯静态+CDN的网站,面对巨大的请求/并发,减轻CDN/源站的压力。

难怪很多网站Logo都采用这种方式。

在网上查阅资料,总结如下:

使用base64图片的优点:

1、减少http请求次数,加快小图像的加载时间。
2、采用base64的图片随着页面一起下载,因此不会存在跨域请求的问题
3、没有图片更新要上传图片,因此不会造成清理图片缓存的问题

使用base64图片的缺点:

1、增加css文件的大小
2、浏览器兼容性
3、解析css的时间增长
经过Base64 编码后的文件体积一般比源文件大 30% 左右

一位CSDN博主顺便提到了另一个概念:cssprites技术

cssprites技术就是将多个图片合成一个大的图片,将多次图片请求合成一张大图的请求,以此来达到减少http请求的次数。

使用cssprites合成一张大图的优缺点
页面具有多种风格,需要换肤功能,可使用CssSprites
图片不随意改动
使用时无需重复图形的内容
没有base64编码成本,降低图片更新的维护难度
-不会增加css文件体积
使用base64直接把图片编码成字符串写入css文件:
无额外请求
对于极小或者及简单图片
-可像独立图片一样使用,比如背景图片重复使用等
没有跨域问题,无需考虑缓存,文件头或者cookies问题
对于base64图片常见误区
base64虽有优点,但是其缺点也很明显,在使用上存在一些明显的缺陷
1、使用base64不代表性能优化,使用base64减少了http请求,但是增加了css文件的体积,css文件体积增大意味着CRP的阻塞

CRP(Critical Rendering Path,关键渲染路径):当浏览器从服务器接>收到一个HTML页面的请求时,到屏幕上渲染出来要经过很多个步骤。浏>览器完成这一系列的运行,或者说渲染出来我们常常称之为“关键渲染路
径”。

三级
图片不会导致关键渲染路径的阻塞,而转换为base64后大大增加了css文件的体积,css文件的体积直接影响渲染,导致空白屏幕时间增长,html和css会阻塞渲染,而图片不会阻塞渲染

浏览器的兼容性:

贴上几个Base64转换工具:

open.soarli.top/webapps/base64/

base64.us/

www.css-js.com/tools/base64.html

tool.oschina.net/encrypt?type=4

参考资料:

blog.csdn.net/qq_46244454/article/details/104188569

blog.csdn.net/steve_sjf/article/details/102628854

最后修改:2021 年 12 月 02 日 08 : 08 PM

发表评论