Skip to content

Instantly share code, notes, and snippets.

@ThaddeusJiang
Created September 19, 2024 07:22
Show Gist options
  • Save ThaddeusJiang/739d3398a652f3127f57f92ee3d06ecd to your computer and use it in GitHub Desktop.
Save ThaddeusJiang/739d3398a652f3127f57f92ee3d06ecd to your computer and use it in GitHub Desktop.

《Fog of War | Remix》 读后感

blog: https://remix.run/blog/fog-of-war

虽然我能理解借助 prefetch 可以提前加载某些 Routes 以提高页面跳转性能,但是过度使用 prefetch 会不会导致服务器过载呢?

prefetch 的问题

  1. 不必要的请求增多
  2. 网络带宽浪费
  3. 数据库压力
  4. 缓存有效性

IMO

先理解需求,在考虑解决方案。过早优化是万恶之源。

其他

  1. project develop 阶段其实可以忽略,make it work first
  2. 分析和监控:分析哪些 routes 需要 prefetch 哪些需要 lazy load
  3. 必要时,甚至需要对一些 routes 进行限流
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment