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
Guille Paz
January 10, 2014
Programming
460
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
270
No me robes el Scroll!
pazguille
0
290
User First
pazguille
1
220
#OfflineFirst
pazguille
3
6k
ES6 in Production
pazguille
10
3.2k
No me hagas esperar!
pazguille
1
210
Hello, Style Guides!
pazguille
0
290
Decoupling your JavaScript
pazguille
0
190
Progressive Enhancement - Is it still important?
pazguille
0
150
Other Decks in Programming
See All in Programming
ローカルLLMでどこまでコードが書けるか -縮小版 / How much code can be written on a local LLM Shortened
kishida
2
190
Vue × Nuxt × Oxc どこまで使える?実運用の現在地
andpad
0
370
Claude Team Plan導入・ガイド
tk3fftk
0
170
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
360
Hunting Vulnerabilities in Symfony with LLMs
vinceamstoutz
0
580
AIを活用したE2Eテスト実装効率化のあゆみ / ebisu-mobile-14-kotetu
kotetuco
0
170
技術記事、 専門家としてのプログラマ、 言語化
mizchi
14
7.4k
壊れたパーサから始める関数型設計と構成的なパーサ #fp_matsuri
raiga0310
2
200
トークンをケチるな、設計しろ:GitHub Copilotを賢く使うコンテキスト戦略
ochtum
0
310
SREは、MCPとSRE Agentをこう使え!
kazumax55
0
150
ECSアプリログをFireLensでコスト削減しようとしたけど諦めた話 in Fargate×Node.js
akihisaikeda
2
4.2k
symfony/aiとlaravel/boost
77web
0
120
Featured
See All Featured
エンジニアに許された特別な時間の終わり
watany
107
250k
Visualization
eitanlees
152
17k
Crafting Experiences
bethany
1
210
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.4k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
260
How STYLIGHT went responsive
nonsquared
100
6.2k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
330
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
180
Odyssey Design
rkendrick25
PRO
2
730
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
290
We Have a Design System, Now What?
morganepeng
55
8.2k
Music & Morning Musume
bryan
47
7.3k
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!