Some tips from my past Web Performance Optimization experience.
- Minimize the css and html (for example with html-minifier-next, a successor of html-minifier and html-minifier-terser*) 1
- Generate brotli files (for html and css files) to deliver them via webserver if supported (
brotli -5 *.{html,css} often yielded the best results for encoding + decoding time, the maximum with -9 does not save much more bytes but results in bigger decoding times)
- Use system fonts and try to avoid big font files (woff2 is best, others are worse) 2
- For images use a decent compression tool with good defaults (caesium, squoosh.app), or run the tools directly (mozjpeg, ...) with needed quality settings (60 - 75% image quality and lossless is often ok)
- Use the right image format (better - worse: webp > jpeg > png) - (I'm not a big fan of avif)
- (Further steps are not possible without using / changing html: lazy loading of images, blurhash, sourceset / picture element)
- ...
Further tips can be found at https://calendar.perfplanet.com/
* I was a maintainer of html-minifier-terser and the new version introduces some improvements
Some tips from my past Web Performance Optimization experience.
brotli -5 *.{html,css}often yielded the best results for encoding + decoding time, the maximum with -9 does not save much more bytes but results in bigger decoding times)Further tips can be found at https://calendar.perfplanet.com/
* I was a maintainer of html-minifier-terser and the new version introduces some improvements
Footnotes
https://github.com/j9t/html-minifier-next ↩
https://github.com/system-fonts/modern-font-stacks ↩