LogoDuyệtSr. Data Engineer
HomeAboutPhotosInsightsCV

Footer

Logo

Resources

  • Rust Tiếng Việt
  • /archives
  • /series
  • /tags
  • Status

me@duyet.net

  • About
  • LinkedIn
  • Resume
  • Projects

© 2026 duyet.net | Sr. Data Engineer | 2026-02-27

Checklist tối ưu hiệu năng React

Note: This post is over 7 years old. The information may be outdated.

Muốn tối ưu hiệu năng React, sau đây là checklist để tăng tốc website sử dụng React

  1. Công cụ do hiệu năng render của từng Component React:

    • Chrome DevTools Performance panel
    • React DevTools profiler
  2. Giảm thiểu tối đa việc các component re-renders:

    • Override shouldComponentUpdate để kiểm soát việc re-render
    • Sử dụng PureComponent class components
    • Sử dụng React.memo functional components
    • Memoize Redux selectors (reselect là một ví dụ)
    • Virtualize super long lists (react-window là một ví dụ)
  3. Công cụ đo hiệu năng app-level với Lighthouse

  4. Tối ưu hiệu năng ở mức ứng dụng

    • Nếu bạn không sử dụng server-side rendering, cắt nhỏ components với React.lazy
    • Nếu bạn sử dụng server-side rendering, cắt nhỏ components với thư viện, giống như loadable-components
    • Sử dụng service worker để cache files. Workbox sẽ giúp bạn rất nhiều trong việc cache resouce.
    • Nếu bạn sử dụng server-side rendering, sử dụng streams thay vì strings (sử dụng renderToNodeStream và renderToStaticNodeStream)
    • Không thể Server-side rendering? Sử dụng pre-render như một biện pháp thay thế. Hãy sử dụng react-snap.
    • Hãy chắc chắn trang React của bạn luôn accessible. Hãy sử dụng React A11y và react-axe.
    • Sử dụng web app manifest nếu bạn muốn user truy cập trang của bạn trên device homescreen.
Mar 3, 2019·7 years ago
|Web|
ReactWeb
|Edit|

Related Posts

Migrate to Cloudflare Pages

Cloudflare just released the Pages, with the most generous free tier, it is all set to compete with Netlify on this front. I just to try it out in this blog.

May 1, 2021·5 years ago
Read more

TL;DR - ES2020: Nullish Coalescing

Nullish coalescing (??) adds the ability to truly check nullish values instead of falsey values.

Jun 28, 2020·6 years ago
Read more

Javascript Shorthands Tips

These Javascript shorthand tips will make your code look more cool and clean.

Oct 20, 2019·6 years ago
Read more

Web Performance 101

Trang web sau sẽ giới thiệu tất tần tật về tối ưu hiệu năng của modern web. Bài viết sẽ giải thích vì sao việc tối ưu là quan trọng, những công nghệ tối ưu và công cụ nào hiện đang được sử dụng, giải thích một cách chi tiết dễ hiểu và cách ứng dụng chúng.

Nov 13, 2018·7 years ago
Read more