biotorrents / gazelle

BioTorrents.de’s version of Gazelle
https://torrents.bio
ISC License
19 stars 3 forks source link

Serve static assets in the WebP and SVG formats #92

Closed pjc09h closed 1 year ago

pjc09h commented 1 year ago

The PNG site images are pretty well compressed, but they might as well be WebP or vectors where possible. Another improvement in this space would involve storing badges as emoji (they're all raster images of emoji anyway). That'd be better for native platform integration, as most of the site icons are already Unicode emoji characters.

May need some database work to store the badges as emoji, maybe a utf8mb4_bin character set:

MariaDB [gazelle_development]> insert into users_friends (userId, friendId, comment) values (666, 666, "💩");
ERROR 1366 (22007): Incorrect string value: '\xF0\x9F\x92\xA9' for column `gazelle_development`.`users_friends`.`comment` at row 1
pjc09h commented 1 year ago

https://github.com/biotorrents/gazelle/commit/2f158de43b39d5bfecfadce61c858b7bfac78030 https://github.com/biotorrents/gazelle/commit/d76037cac2ba3acf2f25c20ea283bcfa6c06c7f4 https://github.com/biotorrents/gazelle/commit/8cd9afa54656bc9e7818cc4ced5ae531bde680f6

This is done, to be bundled with the next update. Unused assets are cleaned up, everything that's not a legacy icon are converted to WebP, and badges use native emoji. The whole database in fact can now use emoji.