SlideShare a Scribd company logo
OPTIMIZE IMAGES FOR WEB
SITE / APP PERFORMANCE
TAKAAKI MIZUNO
WEB SITE LOADING
SPEED IS VERY
IMPORTANT
テキスト
WEB SITE LOADING SPEED IS IMPORTANT
▸ Web site loading speed affect to the Google web search
ranking
テキスト
WEB SITE LOADING SPEED IS IMPORTANT
▸ Web site loading speed affect to the revenue of EC site
▸ One Second Could Cost Amazon $1.6 Billion In Sales Per
Year
テキスト
HOW TO MAKE THE RESPONSE FASTER
▸ Minify HTML/CSS/JS
▸ Combine CSS/JS*1
▸ Multi Subdomains for images*1
▸ Resize Images
▸ Set HTTP cache headers properly
▸ Lazy Loading
▸ Use HTTP/2
*1 It is not effective when you are using HTTP/2
テキスト
YOU CAN CHECK YOUR PAGE WITH
Google Page Speed Insights
https://developers.google.com/speed/pagespeed/insights/
REDUCE IMAGE SIZE WITHOUT
ANY CHANGES
テキスト
WHY OPTIMIZE IMAGE
▸ You can do it TODAY
▸ Really effective
PNG
テキスト
PNG
▸ Never uses full color PNG images ( 24bit / 32bit )
▸ Change to Index Colored PNG with pngquant
▸ Optimize color index with pngrewrite
▸ Optimize deflete compression with AdvanceCOMP
You Can Reduce Image File Size 20%~
JPEG
テキスト
JPEG
▸ Use mozjpeg to optimize Jpeg Images
You Can Reduce Image File Size 20%~
WEBP
テキスト
WEBP
▸ WebP is the Jpeg/PNG alternative image format by Google
▸ Size of image will be 25~34% of Jpeg image
▸ Supported OS/Browsers
▸ Android 4.0~
▸ iOS ( SDWebImage library )
▸ Chrome
▸ IE/Safari/Firefox don’t support
You Can Reduce Image File Size 60%~
テキスト
HOW TO KNOW THE CLIENT SUPPORTS WEBP OR NOT
Accept:image/webp,image/*,*/*;q=0.8
Check Accept HTTP Request Header
テキスト
DEMO
REAL EXAMPLE
テキスト
FOODY.VN
テキスト
ORIGINAL WEB DATA SIZE 5.9MB
html%
css%
js%
img%
other%
Image 52%
3,1MB
テキスト
PNG & JPEG OPTIMIZATION SIZE 5.1MB ( REDUCE 9.2% )
html%
css%
js%
img%
other%
Image 47%
2,6MB
18% Image Size Reduced
テキスト
JPEG TO WEBP SIZE 4.7MB ( REDUCE 17,4% )
html%
css%
js%
img%
other%
Image 42%
2.1MB
33.3% Image Size Reduced
テキスト
JPEG,PNG,GIF TO WEBP SIZE 4.5MB ( REDUCE 21.1% )
html%
css%
js%
img%
other%
Image 42%
1.9MB
40.1% Image Size Reduced
テキスト
DEMO
テキスト
USE IMAGE RESIZING PROXY
https://github.com/cubicdaiya/ngx_small_light
ngx_small_light
テキスト
JUST CHANGE THE IMAGE URL
http://$host:$port/small_light(dw=300,dh=300)/img/image.jpg
http://$host:$port/img/image.jpg
テキスト
Thank You!

More Related Content

Tech Talk #2: Optimize Images For Web Site/App Performance