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
Serving WebP images via content negotiation
Search
Szymon Nowak
November 04, 2015
Programming
94
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Serving WebP images via content negotiation
Lightning talk from meet.js meetup 11/2015
Szymon Nowak
November 04, 2015
More Decks by Szymon Nowak
See All by Szymon Nowak
meet.js Katowice - ES6 Promises 101
szimek
1
230
GDG DevFest 2015 Poland - How to grow your own Babel fish
szimek
0
66
JSConf EU 2015 - How to grow your own Babel fish
szimek
0
330
Other Decks in Programming
See All in Programming
肥大化するレガシーコードに立ち向かうためのインターフェース分離と依存の逆転 / JJUG CCC 2026 Spring
hirokunimaeta
0
540
ユニットテストの先へ:テスト技法で要求・仕様を整理するJava開発実践 / Beyond_Unit_Testing_Practical_Java_Development_Techniques_for_Organizing_Requirements_and_Specifications
shimashima35
0
390
net-httpのHTTP/2対応について
naruse
0
470
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
5
720
「なぜそう決めたのか」を残し続ける仕組み ― Notion AI カスタムエージェント × Slack連携による設計判断の自動記録 - NIKKEI Tech Talk #47
niftycorp
PRO
0
120
JJUG CCC 2026 Spring: JSpecify で実現する Kotlin フレンドリーな Java API 設計
ternbusty
1
160
ECSアプリログをFireLensでコスト削減しようとしたけど諦めた話 in Fargate×Node.js
akihisaikeda
2
4k
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
270
Oxcを導入して開発体験が向上した話
yug1224
4
310
JavaDoc 再入門
nagise
0
320
TypeScript+Orvalで実現する型安全かつ堅牢でスケーラブルなマルチチャネル通知基盤 / TSKaigi Night talks ~after conference~
d0riven
0
330
軽量Java基盤の設計 DIコンテナに頼らない、長期保守と1秒起動の実現 JJUG CCC 2026 Spring
macha64
0
500
Featured
See All Featured
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
230
Scaling GitHub
holman
464
140k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
300
Designing for Timeless Needs
cassininazir
1
250
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.2k
Raft: Consensus for Rubyists
vanstee
141
7.5k
Designing for humans not robots
tammielis
254
26k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
How to Ace a Technical Interview
jacobian
281
24k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
530
Transcript
SERVING WEBP IMAGES VIA CONTENT NEGOTIATION SZYMON NOWAK @SZIMEK
366K
[email protected]
248K
[email protected]
198K
[email protected]
81K
[email protected]
173K
[email protected]
81K
[email protected]
FIREFOX Accept: image/png,image/*;q=0.8,*/*;q=0.5
CHROME Accept: image/webp,image/*,*/*;q=0.8
NGINX if ($http_accept ~* "webp") { set $webp_accept "true"; }
NGINX if ($webp_accept = "true") { rewrite (.*) $1.webp break;
}
NGINX add_header Vary Accept;
https://www.igvita.com/2013/05/01/deploying- webp-via-accept-content-negotiation/
OR USE PICTURE ELEMENT https://developer.mozilla.org/en-US/docs/Web/ HTML/Element/picture
OR USE SERVICE WORKERS http://deanhume.com/Home/BlogPost/service- workers--dynamic-responsive-images-using- webp-images/10132/