[PR #30798] refactor(web): setup status caching #32964

Closed
opened 2026-02-21 20:52:24 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/30798

State: closed
Merged: Yes


Summary

  • Centralize setup status cache handling into utils/setup-status.ts
  • Reuse shared helper in app initializer and global public context
  • Prefetch setup status in parallel to reduce waterfall requests

Why This Speeds Up First Load

Before (sequential requests):

GlobalPublicStoreProvider mounts
    └─► GET /system-features ──────► done
                                       └─► render children
                                              └─► AppInitializer mounts
                                                     └─► GET /setup ──► done

After (parallel requests):

GlobalPublicStoreProvider mounts
    ├─► GET /system-features ──────► done ──► render children
    │                                              └─► AppInitializer reads localStorage (no API call)
    └─► GET /setup ────────────────► done ──► cached to localStorage

Testing

  • pnpm test utils/setup-status.spec.ts (11 tests passing)
  • pnpm lint:fix
  • pnpm type-check:tsgo
**Original Pull Request:** https://github.com/langgenius/dify/pull/30798 **State:** closed **Merged:** Yes --- ## Summary - Centralize setup status cache handling into `utils/setup-status.ts` - Reuse shared helper in app initializer and global public context - Prefetch setup status in parallel to reduce waterfall requests ## Why This Speeds Up First Load **Before (sequential requests):** ``` GlobalPublicStoreProvider mounts └─► GET /system-features ──────► done └─► render children └─► AppInitializer mounts └─► GET /setup ──► done ``` **After (parallel requests):** ``` GlobalPublicStoreProvider mounts ├─► GET /system-features ──────► done ──► render children │ └─► AppInitializer reads localStorage (no API call) └─► GET /setup ────────────────► done ──► cached to localStorage ``` ## Testing - `pnpm test utils/setup-status.spec.ts` (11 tests passing) - `pnpm lint:fix` - `pnpm type-check:tsgo`
yindo added the pull-request label 2026-02-21 20:52:24 -05:00
yindo closed this issue 2026-02-21 20:52:25 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#32964