Lighthouse / PageSpeed - Unused JavaScript

As was already said in this thread, the suggestions given by the tools are just best practice suggestions and don’t necessarily have to have a high impact on the actual score.

The JS is bundled and minified so it’s downloaded in one piece. It’s not larger than a single regular image and is even downloaded after the content has already been rendered (<script> tags are embedded before the closing </body> tag). So even if we removed most of the JS it would probably only have a very tiny effect on the score.

What’s more important is:

  • avoid too much content (count of elements) on the homepage. Turn very long one-page websites into multi-page websites
  • make sure to keep the number of initially downloaded files as little as possible, so lazyload images (otherwise they will be downloaded immediately and delay the rendering) and use icon and SVG elements for illustrations (these will be embedded and don’t cause another download)
  • avoid or defer third-party scripts
  • avoid JS-driven content above the fold (this includes sliders)

Also see the following article: Website Performance / Google PageSpeed - Sitejet Help

@zachary Keep using the SVG element. Most of the time, you’d use every illustration only once on the website. Hence it makes sense to have them embedded into the HTML so they are available immediately. Since HTML is compressed (Gzip) anyway, the embedded SVGs only consume 10-20% of their actual size in bandwidth.

4 Likes