Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
CSS Sprites vs. Data URIs
Search
Guille Paz
January 10, 2014
Programming
470
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
280
No me robes el Scroll!
pazguille
0
300
User First
pazguille
1
230
#OfflineFirst
pazguille
3
6k
ES6 in Production
pazguille
10
3.3k
No me hagas esperar!
pazguille
1
220
Hello, Style Guides!
pazguille
0
300
Decoupling your JavaScript
pazguille
0
210
Progressive Enhancement - Is it still important?
pazguille
0
170
Other Decks in Programming
See All in Programming
GitHubハンズオン講座 — 実務レベルのチーム開発のフローを身につけよう
junhat6
0
110
setup-vp GitLab対応の裏側
naokihaba
0
140
すこし踏み込む CancellationToken
htkym
2
1.5k
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
5.2k
Vue Fes Japan 2026 タイムテーブル徹底解説
448jp
1
580
技術的負債を組織課題として解く-増えすぎたマイクロサービスとの戦い-
reimaru
1
2.6k
カツオ、ご期待ください
suneo3476
0
130
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
310
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
260
iOSDC2026登壇資料.pdf
riofujimon
0
200
技術的負債の返済は、AI時代の複利で効く投資 — 経営としての意思決定とその遂行
curekoshimizu
1
2k
Verilogで学ぶCPU自作入門.pdf
uyuki234
7
3.9k
Featured
See All Featured
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
58k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.4k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
550
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
500
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Ruling the World: When Life Gets Gamed
codingconduct
0
380
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
Paper Plane
katiecoart
PRO
4
53k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
520
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
440
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!