什么是base64编码数据的弊端? [英] What are the drawbacks of base64 encoding data?

查看:141
本文介绍了什么是base64编码数据的弊端?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在过去两年左右的时间,我有恩的base64 codeD多种类型的网络数据:图片,杂项文件文件,文本,和等等。它的实用性,它作为一个临时的资产整合方式(直接在CSS或HTML嵌入到数据,人们不必担心死链接),但有任何缺点,使用这种方法吗?

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?

推荐答案

基于64位EN codeD数据比原始数据约大33%。

The base64 encoded data is about 33% larger than the raw data.

另一个影响是要捆绑几项数据汇集成更大的块。有时这是有积极的影响,有时不利。请求更少的资源是正的,但仅当资源具有相同的缓存状态。如果例如在HTML页中捆绑的图像时,图像不能单独缓存,因为它有每一HTML网页被取出的时间来获取。

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.

这篇关于什么是base64编码数据的弊端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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