Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
CSS Sprites vs. Data URIs
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Guille Paz
January 10, 2014
Programming
0
440
CSS Sprites vs. Data URIs
Are Data URIs better than CSS Sprites?
@pazguille & @taly
Guille Paz
January 10, 2014
Tweet
Share
More Decks by Guille Paz
See All by Guille Paz
The Road to Node
pazguille
0
250
No me robes el Scroll!
pazguille
0
260
User First
pazguille
1
210
#OfflineFirst
pazguille
3
5.9k
ES6 in Production
pazguille
10
3.2k
No me hagas esperar!
pazguille
1
180
Hello, Style Guides!
pazguille
0
270
Decoupling your JavaScript
pazguille
0
180
Progressive Enhancement - Is it still important?
pazguille
0
130
Other Decks in Programming
See All in Programming
Oxlint JS plugins
kazupon
1
890
例外処理とどう使い分ける?Result型を使ったエラー設計 #burikaigi
kajitack
16
6k
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
7.4k
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
230
Data-Centric Kaggle
isax1015
2
770
Grafana:建立系統全知視角的捷徑
blueswen
0
330
AgentCoreとHuman in the Loop
har1101
5
230
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
180
CSC307 Lecture 04
javiergs
PRO
0
660
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
690
なるべく楽してバックエンドに型をつけたい!(楽とは言ってない)
hibiki_cube
0
140
Patterns of Patterns
denyspoltorak
0
1.4k
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
46
8k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
62
49k
Un-Boring Meetings
codingconduct
0
200
Designing for Performance
lara
610
70k
Building Adaptive Systems
keathley
44
2.9k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
940
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.4k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
110
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.6k
Transcript
Data URI The myths
Base64
http://tools.ietf.org/html/rfc3548 Encoding data (files) in plain text
Data URIs Uniform Resource Identifier
A way to include data in a web page
Syntax
<img src=“data:image/png;base64,IVBOR...”>
<img src=“data:image/png;base64,IVBOR...”> • data - name of the scheme
<img src=“data:image/png;base64,IVBOR...”> • data - name of the scheme ◦
image/png - content type
<img src=“data:image/png;base64,IVBOR...”> • data - name of the scheme ◦
image/png - content type • base64 - type of encoding used to encode
<img src=“data:image/png;base64,IVBOR...”> • data - name of the scheme ◦
image/png - content type • base64 - type of encoding used to encode • IVBOR… - the encoded data
Why it rocks
Reduce the number of HTTP requests.
The ability to embed files inside of others files (CSS,
JS, images in-lined in the HTML)
Performance enhancement.
Sure?
None
None
Data URI http://www.webpagetest.org/result/131227_FM_JD4/1/details/
Data URI http://www.webpagetest.org/result/131227_FM_JD4/1/details/
Data URI http://www.webpagetest.org/result/131227_FM_JD4/1/details/
Sprites http://www.webpagetest.org/result/131227_WR_JDT/1/details/
Sprites http://www.webpagetest.org/result/131227_WR_JDT/1/details/
Sprites http://www.webpagetest.org/result/131227_WR_JDT/1/details/
Sprites Data URI
It Sucks!
Increase the size of your HTML document or CSS file.
Sprites Data URI
Make the files themselves larger.
Are not separately cached from their containing document
IE8 limits data URIs to a maximum length of 32
KB.
It’s a pain to maintain
Bad User Experience: 100ms interactivity budget.
None
None
None
Recap
Are not always the best solution
Use on very small resources
Thank you!