Skip to content

Rendering and caching architecture on top of Convex #41

Description

@vdvman1

Question

How do pages render and cache, once Convex is the source of truth?

Settled going in: PPR. Article body and inline annotations are static; other annotations and comment threads are live Convex islands. Promoting an annotation invalidates the article's cache entry. /java/changelog keeps its stable URL — no redirect to a concrete version — with cron-driven invalidation keeping it correct. Inline content is never live, so nothing shifts under a reader. Old articles should behave essentially like static pages.

Decide:

  • The static/dynamic boundary, concretely, per component. Which parts of src/components/java/patch-notes.tsx and src/app/java/changelog/layout.tsx sit in the static shell and which become dynamic islands.
  • Per-article cache lifetimes. A two-year-old article should cache near-permanently; the newest should revalidate fast. Express this with cache components primitives — this is the requirement that motivated the whole map.
  • Invalidation from Convex. The cron and the promote-annotation mutation both live outside Next. How do they invalidate a Vercel cache entry — tagged revalidation via a route handler, a webhook, something else? What is the auth on that endpoint, and what is the latency?
  • /java/changelog specifically. Retire the force-dynamic hack at src/app/java/changelog/page.tsx:8 and explain why the replacement is correct, in terms of the ISR mis-detection diagnosed in Java Changlogs caching too strongly #4. This is the ticket that closes that loop.
  • The version sidebar, which is live (new versions appear without a refresh) but sits in a layout wrapping cached pages.
  • The three liveness behaviours from the map: revision-change notice plus annotation write-lock; live sidebar; live comments. Where each one's subscription lives.
  • Server vs client Convex access. What is read server-side at render (cached) vs subscribed client-side (live), and how the client knows which article revision the static shell was built from — that comparison is what drives the "new version available" notice.
  • What gets deleted. The cache wrapper in src/lib/fetch.ts and request-time fetching in src/server/java/versions.ts, once ingestion is authoritative.

Blocked on the cache components research, the Next 16.3 upgrade, and the article schema.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    wayfinder:grillingWayfinder ticket: HITL conversation (default type)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions