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
250
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
190
Hello, Style Guides!
pazguille
0
280
Decoupling your JavaScript
pazguille
0
180
Progressive Enhancement - Is it still important?
pazguille
0
140
Other Decks in Programming
See All in Programming
日本だけで解禁されているアプリ起動の方法
ryunakayama
0
360
Claude Codeと2つの巻き戻し戦略 / Two Rewind Strategies with Claude Code
fruitriin
0
200
LangChain4jとは一味違うLangChain4j-CDI
kazumura
1
120
Rで始めるML・LLM活用入門
wakamatsu_takumu
0
120
Go1.26 go fixをプロダクトに適用して困ったこと
kurakura0916
0
310
AI主導でFastAPIのWebサービスを作るときに 人間が構造化すべき境界線
okajun35
0
420
go directiveを最新にしすぎないで欲しい話──あるいは、Go 1.26からgo mod initで作られるgo directiveの値が変わる話 / Go 1.26 リリースパーティ
arthur1
2
410
「ブロックテーマでは再現できない」は本当か?
inc2734
0
1.1k
「やめとこ」がなくなった — 1月にZennを始めて22本書いた AI共創開発のリアル
atani14
0
330
RubyとGoでゼロから作る証券システム: 高信頼性が求められるシステムのコードの外側にある設計と運用のリアル
free_world21
0
130
15年目のiOSアプリを1から作り直す技術
teakun
0
570
AI活用のコスパを最大化する方法
ochtum
0
120
Featured
See All Featured
Speed Design
sergeychernyshev
33
1.6k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.3k
Designing for Performance
lara
611
70k
The untapped power of vector embeddings
frankvandijk
2
1.6k
How STYLIGHT went responsive
nonsquared
100
6k
WCS-LA-2024
lcolladotor
0
470
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
290
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
130
Side Projects
sachag
455
43k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
89
Leo the Paperboy
mayatellez
4
1.5k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
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!