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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Guille Paz
January 10, 2014
Programming
450
0
Share
CSS Sprites vs. Data URIs
Are Data URIs better than CSS Sprites?
@pazguille & @taly
Guille Paz
January 10, 2014
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
220
#OfflineFirst
pazguille
3
6k
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
ローカルで稼働するAI エージェントを超えて / beyond-local-ai-agents
gawa
3
280
SkillがSkillを生む:QA観点出しを自動化した
sontixyou
6
3.4k
의존성 주입과 모듈화
fornewid
0
150
JOAI2026 1st solution - heron0519 -
heron0519
0
140
ルールルルルルRubyの中身の予備知識 ── RubyKaigiの前に予習しなイカ?
ydah
1
190
AWS re:Invent 2025の少し振り返り + DevOps AgentとBacklogを連携させてみた
satoshi256kbyte
3
160
HTML-Aware ERB: The Path to Reactive Rendering @ RubyKaigi 2026, Hakodate, Japan
marcoroth
0
150
Don't Prompt Harder, Structure Better
kitasuke
0
770
How We Benchmarked Quarkus: Patterns and anti-patterns
hollycummins
1
150
The Monolith Strikes Back: Why AI Agents ❤️ Rails Monoliths
serradura
0
340
検索設計から 推論設計への重心移動と Recall-First Retrieval
po3rin
1
380
forteeの改修から振り返るPHPerKaigi 2026
muno92
PRO
3
290
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
432
67k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.8k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
99
30 Presentation Tips
portentint
PRO
1
280
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
770
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
480
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
490
Odyssey Design
rkendrick25
PRO
2
580
Google's AI Overviews - The New Search
badams
0
980
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
890
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
53k
GraphQLとの向き合い方2022年版
quramy
50
15k
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!