Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

How a Tester’s Question Led to Lazy‑Loading OCR Packs in PureHub

说明与用途

测试人员发现 PureHub 启动时 OCR 预加载导致延迟。通过路由级延迟加载 OCR 组件,减少了约 30% 的包体积并加快了启动速度。

问题

PureHub’s OCR initialization added a noticeable delay on first launch, hurting the one‑handed mobile experience.

结果

Users now experience a faster app start, and OCR packs are fetched only when needed, keeping the shared mobile UI lightweight.

工作流

  • Identify the performance issue reported by a tester.
  • Decide to refactor OCR to use route‑level lazy chunks.
  • Implement Vue router lazy‑load for the OCR route, importing the OCR component only when the /ocr path is visited.
  • Configure the chunk name and disable preloading.
  • Deploy the updated code.
  • Verify that the app starts faster and OCR packs are fetched on demand.
  • Collect user feedback on the on‑demand loading experience.
  • Consider optional prefetch for most‑used language based on feedback.

证据

We refactored the OCR feature to use route‑level lazy chunks, loading language packs only after the user selects a language. This reduces the initial bundle size by roughly 30 % and speeds up startup.

来源

  • 记录日期: 2026-09-07T13:23:02.758Z