WebSite Performance Improvement - Lighthouse

2021/03/041 min read
bookmark this
Responsive image

Table of Contents

  1. Introduction
  2. Enable Text Compression
  3. Reduce Unused CSS
  4. Reduce Unused JavaScript
  5. Color Contrast Checker
  6. Browser Cache - Disk Cache
  7. Conclusion

Introduction

Google Lighthouse is a powerful tool for auditing website performance, accessibility, and best practices. This post covers a few quick wins to improve your Lighthouse score.

Enable Text Compression

const compression = require('compression');
app.use(compression());

Reduce Unused CSS

Make sure all CSS is minified as a bundle.

Reduce Unused JavaScript

Defer loading scripts for Google Ads or Google Analytics.

Color Contrast Checker

https://coolors.co/contrast-checker/000000-08a045

Browser Cache - Disk Cache

res.set('Cache-control', `public, max-age=${period}`);

Conclusion

By applying these Lighthouse recommendations — enabling text compression, reducing unused CSS and JavaScript, checking color contrast, and setting proper browser cache headers — you can significantly improve your website's performance score.