WebSite Performance Improvement - Lighthouse
2021/03/041 min read
bookmark this
Table of Contents
- Introduction
- Enable Text Compression
- Reduce Unused CSS
- Reduce Unused JavaScript
- Color Contrast Checker
- Browser Cache - Disk Cache
- 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.