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
450
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
260
No me robes el Scroll!
pazguille
0
270
User First
pazguille
1
210
#OfflineFirst
pazguille
3
5.9k
ES6 in Production
pazguille
10
3.2k
No me hagas esperar!
pazguille
1
200
Hello, Style Guides!
pazguille
0
280
Decoupling your JavaScript
pazguille
0
190
Progressive Enhancement - Is it still important?
pazguille
0
140
Other Decks in Programming
See All in Programming
ロボットのための工場に灯りは要らない
watany
10
2.8k
encoding/json/v2のUnmarshalはこう変わった:内部実装で見る設計改善
kurakura0916
0
410
ふつうの Rubyist、ちいさなデバイス、大きな一年
bash0c7
0
940
SourceGeneratorのマーカー属性問題について
htkym
0
200
AWS Infrastructure as Code の新機能 2025 総まとめ 〜SA 4人による怒涛のデモ祭り〜
konokenj
10
3.4k
How to stabilize UI tests using XCTest
akkeylab
0
130
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
480
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
280
Agentic AI: Evolution oder Revolution
mobilelarson
PRO
0
170
Agent Skills Workshop - AIへの頼み方を仕組み化する
gotalab555
15
8.7k
2026年は Rust 置き換えが流行る! / 20260220-niigata-5min-tech
girigiribauer
0
230
The Ralph Wiggum Loop: First Principles of Autonomous Development
sembayui
0
3.7k
Featured
See All Featured
Un-Boring Meetings
codingconduct
0
220
WCS-LA-2024
lcolladotor
0
480
4 Signs Your Business is Dying
shpigford
187
22k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
350
Claude Code のすすめ
schroneko
67
220k
How to train your dragon (web standard)
notwaldorf
97
6.6k
So, you think you're a good person
axbom
PRO
2
2k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
990
How to Ace a Technical Interview
jacobian
281
24k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
680
Skip the Path - Find Your Career Trail
mkilby
1
79
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
200
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!