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
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
Amazon Bedrockを活用したRAGの品質管理パイプライン構築
tosuri13
5
900
New in Go 1.26 Implementing go fix in product development
sunecosuri
0
100
株式会社 Sun terras カンパニーデック
sunterras
0
1.9k
TROCCOで実現するkintone+BigQueryによるオペレーション改善
ssxota
0
110
要求定義・仕様記述・設計・検証の手引き - 理論から学ぶ明確で統一された成果物定義
orgachem
PRO
1
500
文字コードの話
qnighy
43
16k
15年目のiOSアプリを1から作り直す技術
teakun
0
570
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
2.2k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
310
RubyとGoでゼロから作る証券システム: 高信頼性が求められるシステムのコードの外側にある設計と運用のリアル
free_world21
0
130
CDIの誤解しがちな仕様とその対処TIPS
futokiyo
0
140
Agent Skills Workshop - AIへの頼み方を仕組み化する
gotalab555
13
7.4k
Featured
See All Featured
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
67
37k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
Abbi's Birthday
coloredviolet
2
5k
Designing for humans not robots
tammielis
254
26k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
Producing Creativity
orderedlist
PRO
348
40k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
750
The SEO identity crisis: Don't let AI make you average
varn
0
400
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
360
Information Architects: The Missing Link in Design Systems
soysaucechin
0
810
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.8k
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!