Skip to content

perf: extend author trust cache#94

Merged
dirtybits merged 1 commit into
mainfrom
feat/author-trust-cache-60s
Jul 10, 2026
Merged

perf: extend author trust cache#94
dirtybits merged 1 commit into
mainfrom
feat/author-trust-cache-60s

Conversation

@dirtybits

@dirtybits dirtybits commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Extend the author trust in-memory cache from 30s to 60s so repeated browse/detail trust lookups reuse fresh results longer.
  • Align the Base author trust cache with the shared cache policy instead of a hardcoded TTL.
  • Add a route test assertion that the author GET response advertises the 60-second cache window.

Test Plan

  • npm exec --workspace @agentvouch/web vitest run __tests__/api/author-route.test.ts
  • npm exec --workspace @agentvouch/web -- prettier --check lib/cachePolicy.ts lib/baseAuthorTrust.ts __tests__/api/author-route.test.ts
  • git diff --check

Notes

  • npm run typecheck --workspace @agentvouch/web still fails in app/layout.tsx on an existing missing module declaration for @vercel/speed-insights/next.

Note

Low Risk
Caching-only changes with no auth or trust computation logic; slightly staler author trust at the edge and in-process until TTLs expire.

Overview
Public author trust responses are cached longer at the edge: PUBLIC_ROUTE_CACHE_SECONDS.authorTrust moves from 30s to 60s, so routes like GET /api/author/[pubkey] emit Cache-Control with s-maxage=60 (covered by a new assertion in author-route.test.ts).

Base author trust (baseAuthorTrust.ts) no longer hardcodes a 30s in-memory TTL; it reads IN_MEMORY_CACHE_TTL_MS.authorTrust from cachePolicy.ts, keeping server-side caching aligned with the shared policy as those values evolve.

Reviewed by Cursor Bugbot for commit c158663. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor

cursor Bot commented Jul 9, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_cb0ca65f-9071-4fbd-8af8-23d1497ef9ad)

@dirtybits dirtybits merged commit 0cdc9df into main Jul 10, 2026
4 checks passed
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