Skip to content

Instantly share code, notes, and snippets.

@stevepentler
Created August 8, 2018 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevepentler/c8048dd8e65b96317cbba4e601682546 to your computer and use it in GitHub Desktop.
Save stevepentler/c8048dd8e65b96317cbba4e601682546 to your computer and use it in GitHub Desktop.
Image Compresssion
A. GIF doubled in size for standard image, 6.7KB => 13.2
- fully supported
- no gains for standard images without significant blocks of color
B. WebP was reliably 2/3 original size. 26.3KB => 17.8
- only works in Chrome/Opera, Firefox is considering support but I wouldn't count on it
- would require backfilling webp data (but for large/trafficked orgs this could be worthwile)
- JS side - detect chrome/opera, change AWS extension to .webp
- Save on AWS feeds, speed up lazy loading and UX considerably
- Couldn't find a functional polyfill for unsupported browsers (webp-hero package)
- Don't want conditional responses (one persion receives one extension, another a different extension) from the API, so would prefer to keep on front end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment