Project Icon

Front-End-Performance-Checklist

前端性能优化清单 提升网站速度和用户体验

Front-End-Performance-Checklist是一个全面的前端性能优化清单,涵盖HTML、CSS和JavaScript的最佳实践。项目提供代码压缩、资源优化、缓存策略等关键优化建议,并配有详细解释和实用工具,帮助开发者系统提升网站加载速度和响应性,改善用户体验。


Front-End Performance Checklist

  Front-End Performance Checklist  


🚨 Currently working on new version of frontendchecklist.io
(that will include the current performance).
Feel free to discuss any feature you would like to see. Thanks for your support!


🎮 The only Front-End Performance Checklist that runs faster than the others.

One simple rule: "Design and code with performance in mind"

      PRs Welcome         Discord           Licence MIT  

  How To UseContributingProduct Hunt

🇨🇳 🇫🇷 🇰🇷 🇵🇹 🇷🇺 🇯🇵 🇮🇷

Other Checklists:
🗂 Front-End Checklist • 💎 Front-End Design Checklist

Introduction

Performance is a huge subject, but it's not always a "back-end" or an "admin" subject: it's a Front-End responsibility too. The Front-End Performance Checklist is an exhaustive list of elements you should check or at least be aware of, as a Front-End developer and apply to your project (personal and professional).

How to use?

For each rule, you will have a paragraph explaining why this rule is important and how you can fix it. For more deep information, you should find links that will point to 🛠 tools, 📖 articles or 📹 medias that can complete the checklist.

All items in the Front-End Performance Checklist are essentials to achieve the highest performance score but you would find an indicator to help you to eventually prioritised some rules amount others. There are 3 levels of priority:

  • ![Low][low] means that the item has a low priority.
  • ![Medium][medium] means that the item has a medium priority. You shouldn't avoid tackling that item.
  • ![High][high] means that the item has a high priority. You can't avoid following that rule and implement the corrections recommended.

Performance tools

List of the tools you can use to test or monitor your website or application:

References


HTML

![html]

  • Minified HTML: ![medium] The HTML code is minified, comments, white spaces and new lines are removed from production files.

    Why:

    Removing all unnecessary spaces, comments and attributes will reduce the size of your HTML and speed up your site's page load times and obviously lighten the download for your user.

    How:

    Most of the frameworks have plugins to facilitate the minification of the webpages. You can use a bunch of NPM modules that can do the job for you automatically.

  • Place CSS tags always before JavaScript tags: ![high] Ensure that your CSS is always loaded before having JavaScript code.

    <!-- Not recommended -->
    <script src="jquery.js"></script>
    <script src="foo.js"></script>
    <link rel="stylesheet" href="foo.css"/>
    
    <!-- Recommended -->
    <link rel="stylesheet" href="foo.css"/>
    <script src="jquery.js"></script>
    <script src="foo.js"></script>
    

    Why:

    Having your CSS tags before any JavaScript enables better, parallel download which speed up browser rendering time.

    How:

    ⁃ Ensure that <link> and <style> in your <head> are always before your <script>.

  • Minimize the number of iframes: ![high] Use iframes only if you don't have any other technical possibility. Try to avoid iframes as much as you can.

  • Pre-load optimization with prefetch, dns-prefetch and prerender: ![low] Popular browsers can use directive on <link> tag and "rel" attribute with certain keywords to pre-load specific URLs.

    Why:

    Prefetching allows a browser to silently fetch the necessary resources needed to display content that a user might access in the near future. The browser is able to store these resources in its cache and speed up the way web pages load when they are using different domains for page resources. When a web page has finished loading and the idle time has passed, the browser begins downloading other resources. When a user go in a particular link (already prefetched), the content will be instantly served.

    How:

    ⁃ Ensure that <link> is in your <head> section.

⬆ back to top

CSS

![css]

  • Minification: ![high] All CSS files are minified, comments, white spaces and new lines are removed from production files.

    Why:

    When CSS files are minified, the content is loaded faster and less data is sent to the client. It's important to always minify CSS files in production. It is beneficial for the user as it is for any business who wants to lower bandwidth costs and lower resource usage.

    How:

    ⁃ Use tools to minify your files automatically before or during your build or your deployment.

  • Concatenation: ![medium] CSS files are concatenated in a single file (Not always valid for HTTP/2).

    
    <!-- Not recommended -->
    <link rel="stylesheet" href="foo.css"/>
    <link rel="stylesheet" href="bar.css"/>
    
    <!-- Recommended -->
    <link rel="stylesheet" href="foobar.css"/>
    

    Why:

    If you are still using HTTP/1, you may need to still concatenate your files, it's less true if your server use HTTP/2 (tests should be made).

    How:

    ⁃ Use online tool or any plugin before or during your build or your deployment to concatenate your files.
    ⁃ Ensure, of course, that concatenation does not break your project.

  • Non-blocking: ![high] CSS files need to be non-blocking to prevent the DOM from taking time to load.

    <link rel="preload" href="global.min.css" as="style" onload="this.rel='stylesheet'">
    <noscript><link rel="stylesheet" href="global.min.css"></noscript>
    

    Why:

    CSS files can block the page load and delay the rendering of your page. Using preload can actually load the CSS files before the browser starts showing the content of the page.

    How:

    ⁃ You need to add the rel attribute with the preload value and add as="style" on the <link> element.

  • Unused CSS: ![medium] Remove unused CSS selectors.

    Why:

    Removing unused CSS selectors can reduce the size of your files and then speed up the load of your assets.

    How:

    ⁃ ⚠️ Always check if the framework CSS you want to use don't already has a reset / normalize code included. Sometimes you may not need everything that is inside your reset / normalize file.

  • Embedded or inline CSS: ![high] Avoid using embed or inline CSS inside your <body> *(Not valid
项目侧边栏1项目侧边栏2
推荐项目
Project Cover

豆包MarsCode

豆包 MarsCode 是一款革命性的编程助手,通过AI技术提供代码补全、单测生成、代码解释和智能问答等功能,支持100+编程语言,与主流编辑器无缝集成,显著提升开发效率和代码质量。

Project Cover

问小白

问小白是一个基于 DeepSeek R1 模型的智能对话平台,专为用户提供高效、贴心的对话体验。实时在线,支持深度思考和联网搜索。免费不限次数,帮用户写作、创作、分析和规划,各种任务随时完成!

Project Cover

白日梦AI

白日梦AI提供专注于AI视频生成的多样化功能,包括文生视频、动态画面和形象生成等,帮助用户快速上手,创造专业级内容。

Project Cover

有言AI

有言平台提供一站式AIGC视频创作解决方案,通过智能技术简化视频制作流程。无论是企业宣传还是个人分享,有言都能帮助用户快速、轻松地制作出专业级别的视频内容。

Project Cover

讯飞绘镜

讯飞绘镜是一个支持从创意到完整视频创作的智能平台,用户可以快速生成视频素材并创作独特的音乐视频和故事。平台提供多样化的主题和精选作品,帮助用户探索创意灵感。

Project Cover

讯飞文书

讯飞文书依托讯飞星火大模型,为文书写作者提供从素材筹备到稿件撰写及审稿的全程支持。通过录音智记和以稿写稿等功能,满足事务性工作的高频需求,帮助撰稿人节省精力,提高效率,优化工作与生活。

Project Cover

阿里绘蛙

绘蛙是阿里巴巴集团推出的革命性AI电商营销平台。利用尖端人工智能技术,为商家提供一键生成商品图和营销文案的服务,显著提升内容创作效率和营销效果。适用于淘宝、天猫等电商平台,让商品第一时间被种草。

Project Cover

Trae

Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。

Project Cover

AIWritePaper论文写作

AIWritePaper论文写作是一站式AI论文写作辅助工具,简化了选题、文献检索至论文撰写的整个过程。通过简单设定,平台可快速生成高质量论文大纲和全文,配合图表、参考文献等一应俱全,同时提供开题报告和答辩PPT等增值服务,保障数据安全,有效提升写作效率和论文质量。

投诉举报邮箱: service@vectorlightyear.com
@2024 懂AI·鲁ICP备2024100362号-6·鲁公网安备37021002001498号