V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
metrue
V2EX  ›  程序员

你们是如何改善首屏加载速度呢?

  •  
  •   metrue ·
    metrue · Feb 4, 2017 · 4604 views
    This topic created in 3375 days ago, the information mentioned may be changed or developed.

    现在的 Web app 基于 React ,首屏加载速度堪忧,正在努力优化中。

    6 replies    2017-02-04 21:08:54 +08:00
    cismous
        1
    cismous  
       Feb 4, 2017
    官方提出的解决方案就是服务端优化吧
    lozio
        2
    lozio  
       Feb 4, 2017
    用 webpack 做了 code spliting 了吗? 根据路由加载 bundle 块就可以提升很多速度了。 https://webpack.github.io/docs/code-splitting.html
    Warder
        3
    Warder  
       Feb 4, 2017 via Android
    看问题主要在哪了, js render 执行时间太长, 还是, bundle 和静态资源加载太久?
    metrue
        4
    metrue  
    OP
       Feb 4, 2017
    @Warder @lozio 两位提到的都在进行中。
    dantegg
        5
    dantegg  
       Feb 4, 2017
    服务端渲染
    react router 按需加载
    webpack 优化,把 react , redux 这种提取出来用 cdn
    metrue
        6
    metrue  
    OP
       Feb 4, 2017
    @dantegg 服务端渲染确实会有很大提高,但是目前暂不考虑。目前的优化重点确实是 webpack 部分。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   794 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 20:26 · PVG 04:26 · LAX 13:26 · JFK 16:26
    ♥ Do have faith in what you're doing.