Add /api/landing timing + source diagnostics#12
Open
dirtybits wants to merge 2 commits into
Open
Conversation
- /api/landing now emits Server-Timing (snapshot vs compute duration) and an X-AgentVouch-Source header (snapshot-hit | snapshot-stale | live-compute | snapshot-error) so the metrics load path is observable in DevTools. This mirrors the Server-Timing the /api/skills route already emits, and makes it obvious whether the fast Postgres snapshot path or the slow on-chain fallback is being taken in production. - Fix a type-only error in authorTrustView.test.ts (CachedTrustRow typing) that vitest did not catch.
- Extend stale-while-revalidate windows for the public card/metrics lists so a low-traffic site serves an instant (slightly stale) edge response on sporadic visits while the function revalidates in the background. s-maxage stays modest so data still refreshes regularly. - Add docs/FAST_SKILL_CARDS.md: where request time actually goes (client waterfall + cold Neon + cold-function DDL + API) and the ranked, sequenced levers to make cards blazingly fast (server-render via ISR is the top win).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds request-path observability to
/api/landingso we can see, in production, whether metrics are served from the fast Postgres snapshot or the slow on-chain fallback — and how long the DB read takes. This is a diagnostic step toward the "homepage/marketplace still feels slow" report./api/landingnow emits:X-AgentVouch-Source: snapshot-hit | snapshot-stale | live-compute | snapshot-errorServer-Timing: snapshot;dur=<ms>, compute;dur=<ms>Server-Timingthe/api/skillsroute already emits, making the metrics load path visible in DevTools → Network.authorTrustView.test.ts(CachedTrustRow typing) that vitest didn't catch.How to read it
Open the homepage with DevTools → Network:
/api/landing→X-AgentVouch-Source(snapshot-hit= fast;live-compute/snapshot-error= slow fallback) andServer-Timingsnapshot;dur=(big number = cold Neon)./api/skills?mode=fast→ existingServer-Timingdb;dur=.No behavior change to the payloads. Full web suite green; tsc + ESLint clean.
Generated by Claude Code