fix(web): stop embedding the full catalog in the compare page shell - #106
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Merge as is — The diff removes full catalog records while preserving comparison dataThe compare page now sends only picker metadata and fetches the two selected canonical records through a bounded same-origin route; the route preserves the fields consumed by the table, and the existing cross-app compare endpoint is a different response surface. No blocking correctness or safety issue is present. A failed request is cached as Worth noting, not blocking
Merge state: The PR is open and marked mergeable. Vercel Preview Comments is successful and Vercel Agent Review is neutral; the listed build, lint, validation, and Workers checks are null, while approvals and unresolved-thread status are unknown. Evidence · 4 verified · 1 not verifiedVerified
Not verified
Read all four changed files plus the existing web search route, data layer, provider icon, markdown route, configuration, and cross-app compare surface. No code was executed; the reported artifact sizes, build, and browser smoke remain unverified. No prior review threads or review ledger were supplied.
Comment Review by Rupic. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
modelpedia-api | a11f1db | Commit Preview URL Branch Preview URL |
Aug 31 2026, 05:52 AM |
There was a problem hiding this comment.
1 inline comment below, on apps/web/components/shared/model-compare.tsx.
Full review: #106 (comment)
problem
/compareserves 502FALLBACK_BODY_TOO_LARGEon every cache MISS (crawlers walking unique?a=params hit it constantly; ~100 x 502 in 6h, driving the Axiom "Vercel long-tail 5xx" monitor). the prerendered shell embedded the full catalog: every model object spread whole into client props, each row carrying its provider's entire inline SVG. the builtcompare.htmlweighed 23.2MB, past Vercel's fallback body limit.root cause
the compare view only ever needs full data for the two selected models, but the page shipped all ~8000 models' full projections (plus 8000 duplicated provider SVGs) inside the static flight payload.
change
{id, name, provider}per model plus the alias map; provider names and icons resolve client-side via the already-bundledgetProvider./api/compare-models?ids=route handler (same pattern as/api/search, same build = zero data drift), edge-cached withs-maxage=3600.ModelCompareresolves selections from fetched state with a loading message; unknown ids degrade to the picker hint.compare.htmldrops 23.2MB → 0.95MB (-96%).verification
pnpm --filter web buildgreen (route table:/comparestatic,/api/compare-modelsdynamic); artifact sizes measured before/after;next startsmoke: page 200, API returns both projections; browser pass on/compare?a=xai/grok-4.6&b=openai/gpt-5.2renders the full comparison table with icons, pricing, and capability rows.