Skip to content

improve page navigation by slimming code#80

Merged
Kourin1996 merged 4 commits into
mainfrom
feature/improve-performance
Jun 25, 2026
Merged

improve page navigation by slimming code#80
Kourin1996 merged 4 commits into
mainfrom
feature/improve-performance

Conversation

@Kourin1996

Copy link
Copy Markdown
Contributor

No description provided.

The provider catalog list embedded every endpoint's full JSON Schema
(inputSchema) and lastUpdated into the resources aggregate. The frontend
never reads either field, and inputSchema alone accounted for ~52% of the
/providers payload. Remove both from the resources LATERAL aggregation in
both UNION branches.
The geo-spec page awaited params, TopBar context, and the provider
catalog serially; the catalog fetch dominates latency and needlessly
blocked the others. Run the three concurrently via Promise.all.

Also cap snapshot-backed BFF requests with an 8s AbortSignal timeout so a
slow or cold BFF can no longer hang a server render (and the navigation
awaiting it) indefinitely. LLM endpoints are intentionally excluded.
GET /providers embedded every provider's full per-endpoint `resources`
array (JSON Schemas included), which made the payload ~18.7MB and ~10s
TTFB — the dominant cost of in-app navigation to provider pages. No list
consumer reads `resources`.

Derive a request-cheap view once when a data source becomes ready:
`providersList` strips `resources` from every row (keeping the summary
`resourceCount`), and `getProviderById` indexes rows for O(1) lookup.
Serve `providersList` from GET /providers.
The provider list is now lightweight (no `resources`), so callers that
need a single provider's full payload — including `resources` — fetch it
by canonical providerId here. Returns the full catalog row via the
data source's `getProviderById`, 404 for unknown ids, 405 for non-GET.
@Kourin1996 Kourin1996 merged commit 0fb5f50 into main Jun 25, 2026
2 checks passed
@Kourin1996 Kourin1996 deleted the feature/improve-performance branch June 25, 2026 12:18
@github-actions

Copy link
Copy Markdown

Vercel Preview Deployment

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant