Skip to content

托管环境整页打开记录页约 16 秒:启动请求分 5 段串行,/api/v1/packages 每次整页都下载 472KB #35416

Closed

Description

@objectstack-fleet

coordinator#1 · hotlong · session_85eb0287cb754f0f9c2bed54cab9abff

立卡门类别:④ 协调节点的子单,承父单 #34571(控制台核心业务操作体验专题,维护者直派)。⛔ 不是认领。
维护者 2026-11-19 原话:「用浏览器看一下右侧最新的界面,重新测试核心界面,提出界面优化和用户体验改进建议,和我沟通」;看过意见后:「你提的意见都同意,立卡」。

维护者 2026-11-19 补充:「整页打开很慢(托管环境)。是网速的问题。你也可以具体分析一下。」

现状(单次测量:托管环境 os-4e4qa4.objectos.app(预览版,控制台资源 index-BLjIlyDm.js,比 origin/main 旧),zh-CN,1280×800,2026-11-19;浏览器 Resource Timing + 响应里的 Server-Timing;JS/CSS 全部命中本地缓存,传输 0 字节)

整页打开 …/crm_opportunity/record/<id>,最后一个页面数据请求在 16.3 秒返回。

段 时间 这一段在等什么
1 0–0.9s HTML(TTFB 908ms)
2 0.9–1.9s /auth/get-session(服务端 616ms)
3 2.0–5.8s 12 个并发请求;最慢 /auth/me/permissions 服务端 3252ms、/meta/app/crm_enterprise/bundle 3374ms
4 5.8–7.2s /meta/page、/me/apps,再 /meta/object
5 7.2–16.3s 16 个并发请求;/data/crm_opportunity/<id>/page 服务端 4422ms,浏览器侧 TTFB 8983ms
  • 网络基线:到边缘节点(LAX)一个来回约 300ms;空闲时小接口约 430ms(origin 约 100ms)。5 段串行就是约 1.5–2.5 秒纯往返。
  • 带宽:/api/v1/packages 压缩后 472KB(解压 3.2MB),第 5 段里它下载了 6.3 秒;同一条 HTTP/2 连接上的其他小响应(1–4KB)服务端 3 秒左右就算完了,浏览器却在 8–9 秒才收到。这一部分确实随网速变化。
  • 服务端:空闲时 0.1–0.6 秒的接口,并发时 runtime 变成 2–4.4 秒(例如 /i18n/locales 空闲约 100ms,启动时 2598ms)。这一部分与网速无关(容器并发处理能力,属 cloud 侧,本卡只记录数据)。
  • 另见:中文界面仍加载了 i18n-locale-en(198KB,已缓存)。

⚠ 只测了一次,测时面板在后台,绝对数值可能偏大;各段的先后关系和 Server-Timing 数值不受影响。

要做的

  1. /api/v1/packages:启动时不取全量(记录页用不到 3.2MB 的包清单);改成按需、或只取启动需要的字段,或可缓存(ETag/304)。
  2. 把串行的段压平:/auth/me/permissions、/meta/page、/me/apps、/meta/object 能并发的并发,页面数据请求不必等到第 5 段才发。
  3. 先出页面骨架:会话确认后就渲染应用外壳,不停在「正在打开你的控制台…」直到全部元数据到齐。
  4. 在卡上回贴改动前后同一页面的分段时间。

不做的

  • 不在本卡处理服务端并发耗时(如需要,另立 cloud 卡)。

验收

  • 同一环境、同一页面、JS 已缓存的整页打开,页面数据请求的发出时间从 7.3 秒明显提前,/api/v1/packages 不再出现在记录页的启动请求里(或返回 304)。

Reader: domain:ui 车道,控制台启动链路(ui/apps/console、ui/packages/app-shell discovery/bootstrap)。

Dedupe: packages 整页 加载 慢、performance console boot waterfall、/api/v1/packages payload(objectstack / cloud,open)→ 0。

Activity

  1. added
    enhancement
    priority:p2
    domain:ui
    on Nov 19, 2026
  2. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in domain:ui · pm:queue; rationale: area:ux · Bug (a UX problem from the coordinator's walkthrough). The grade the coordinator set stands, under the UX rule (p1 only where every user hits it every time). Issue type set to Bug.

  3. added
    pm:queue
    on Nov 19, 2026
  4. objectstack-fleet commented on Nov 21, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

    Claim: card thread · 2026-11-21T03:50Z
    Area: b1-CX
    Session: session_01L6bhgUVVocvc9dVySV9DVf (the card thread)
    Account: os-sales
    Branch: claude/project-thread-joopl5
    Seat: repo:objectstack#1
    Domain: domain:ui
    File surface: ui/packages/app-shell/src/console/appObjectScope.ts (the root prefetch starts a record route's /meta/page and package object scope beside the permissions read), ui/packages/app-shell/src/views/studio-design/packages-io.ts (fetchSessionPackages waits until the page's own requests settle, so /api/v1/packages leaves the boot path), possibly ui/apps/console/src/AppContent.tsx (/me/apps early only if still on the path), new tests, a changeset.
    Container & model: L, mode:thread, model: opus, effort: high
    Clause-②: no
    Metadata-protocol: none
    Premise: re-read on main 9a8bb83d by the card thread: holds, measured locally (showcase, 300ms RTT / 6 Mbps throttle, JS cached; /mnt/project-files/build-seat1/35416/before-main.txt). Page data leaves at 1.25–1.48s after four serial waves; the card's five segments were an older hosted build. Causes: the root prefetch passes no page-list reader, so /meta/page and the object scope wait for AppContent, which mounts after /auth/me/permissions; and /api/v1/packages (1.3MB unpacked) is the app bar's Studio-entry gate.
    Basis: card #35416, a p2 child of epic #34571, which the maintainer handed to this seat on 2026-11-21 03:24:57Z (「34571 专题你也接手」).
    Scope: card items 1, 2 and 4. Not here, each to a follow-up card the seat files: item 3 (render the shell before the readiness gate), and a trimmed or cacheable /api/v1/packages (a response change, so a contract face). The before/after numbers are local and throttled, since the hosted environment is not reachable from the container; a hosted re-measure after the next staging deploy is recorded on the card.
    Resume-from: none
    Fold-or-serial: serial; no fold. Does not touch MetadataProvider.tsx (#35921) or useStudioDesignGate.ts (#35975). The branch is the card thread's harness push branch, a measured platform exception to claude/issue-<n>-<slug>. The PR carries Fixes #35416.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:uxdomain:uienhancementpm:queuepriority:p2

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions