mirror of
https://github.com/suitenumerique/meet.git
synced 2026-11-21 07:16:36 +00:00
b3e99a9f8b
The three intro slider illustrations were the heaviest part of the homepage. On a cold load of the production homepage (cache disabled), the browser transferred 2.67 MB in total, of which 2.00 MB was these three PNG files: 75% of the page weight, and about 3.5 times all the JavaScript combined (579 kB). HTTP compression cannot help here, PNG being already compressed. The files are heavy because of the grain texture applied on the illustrations, which a lossless format has to store pixel by pixel. Encoded as WebP at quality 90, which preserves the grain, the three slides go from 2.00 MB to 182 kB (-91%). The homepage cold load drops from 2.67 MB to about 0.86 MB (-68%), and the illustrations now account for about 21% of the transfer instead of 75%. The fourth illustration, used on the recording screens, gets the same treatment (721 kB to 84 kB). We checked in PostHog that most of our users are on browser versions supporting WebP. For the remaining ones, a new Picture primitive renders a <picture> element with the WebP file as a source and the original PNG as the <img> fallback, so nobody loses the illustrations. Add webp to the nginx static assets location, otherwise the new files would be served without the 30 days cache headers.