Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: embed webp in svg output #96

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

privatenumber
Copy link
Member

@privatenumber privatenumber commented Nov 6, 2024

Description

  • Store images in WebP by default (previously PNG). This reduces cache size.
  • SVGs embed WebP, reducing SVG file size
  • PNG & WebP output formats re-generate SVGs with PNGs because sharp only supports rendering PNGs inside SVGs

Performance improvements

Cache size
  • Before: 991 KB
  • After: 381 KB
Tiers SVG
Before (320 KB) After (148 KB)
sponsors sponsors
Circles SVG
Before (431 KB) After (197 KB)
sponsors sponsors

Linked Issues

Additional context

@privatenumber privatenumber force-pushed the svg-webp branch 2 times, most recently from 589bd87 to 0b77f48 Compare November 6, 2024 05:28
@privatenumber privatenumber marked this pull request as ready for review November 6, 2024 05:46
@privatenumber privatenumber merged commit 7385fc7 into antfu-collective:main Nov 6, 2024
1 check passed
@privatenumber privatenumber deleted the svg-webp branch November 6, 2024 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant