我们是如何提升SmashingMag网站性能的

原文信息: 查看原文查看原文

How We Improved SmashingMag Performance

- Vitaly Friedman

SmashingMag 是一个技术博客网站,使用React编写的前端页面。他们最近做了一些web性能优化,提升了核心页面指标(Core Web Vitals)参数。

作为一个技术博客网站,数据基本上都是静态的数据,如CSS、图片、JavaScript,还有一些评论等。

在这些要优化的文件中,最麻烦的是JavaScript,它会阻塞主线程数百毫秒。

web performance isn’t a single value; it’s a distribution. Even if a web experience is heavily and thoroughly an optimized all-around performance, it can’t be just fast. It might be fast to some visitors, but ultimately it will also be slower (or slow) to some others.

通过有针对性去分析JavaScript、CSS代码及文件,有效提升了网站的整体像你。文中有一组优化前后的Lighthouse分数对比,优化前的主页分数在60-68之间,优化后的分数达到了90到100,在移动端的分数也达到了65到80。

分享于 2021-01-31

访问量 707

预览图片