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
AgentCoreとHuman in the Loop
har1101
5
230
dchart: charts from deck markup
ajstarks
3
990
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
190
Oxlint JS plugins
kazupon
1
880
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
190
Package Management Learnings from Homebrew
mikemcquaid
0
220
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
260
余白を設計しフロントエンド開発を 加速させる
tsukuha
7
2.1k
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
120
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
220
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
220
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
370
Featured
See All Featured
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
130
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
300
How to Ace a Technical Interview
jacobian
281
24k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.6k
Making the Leap to Tech Lead
cromwellryan
135
9.7k
Amusing Abliteration
ianozsvald
0
99
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
240
Imperfection Machines: The Place of Print at Facebook
scottboms
269
14k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
700
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
96
New Earth Scene 8
popppiees
1
1.5k
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!