Skip to content

Fix stale catalog counts via ISR revalidation (SOL-4)#6

Open
VisionaireLabs wants to merge 1 commit into
masterfrom
fix/catalog-counts-isr
Open

Fix stale catalog counts via ISR revalidation (SOL-4)#6
VisionaireLabs wants to merge 1 commit into
masterfrom
fix/catalog-counts-isr

Conversation

@VisionaireLabs
Copy link
Copy Markdown
Collaborator

Summary

  • Catalog count pages (/, /skills, /official) had no revalidate set, so Next.js emits Cache-Control: s-maxage=31536000 (one year). When lib/skills.ts (or lib/clawhub.ts via the weekly cron) changes and Vercel ships a new build, a CDN can still serve year-old counts until its own TTL expires.
  • Add export const revalidate = 3600 to those three pages. The build output now shows them as Revalidate: 1h, Expire: 1y instead of fully static. After the next deploy, the edge can hold at most one hour past the rebuild.
  • The home page was "use client", which is incompatible with cleanly using route segment config and didn't actually need to be a Client Component. Removed the directive and moved the featured-card hover effect from inline onMouseEnter/onMouseLeave to a .ss-featured-card:hover CSS rule.

Why ISR (and not force-dynamic)

Counts are pure derivations of bundled data, so they only change when a deploy lands. ISR is the cheapest way to bound CDN staleness without forcing every request through a function. Per node_modules/next/dist/docs/01-app/02-guides/cdn-caching.md: ISR pages get s-maxage={revalidate}, stale-while-revalidate=... — exactly what we want.

Test plan

  • npm run build — succeeds; output table confirms /, /skills, /official are now ISR with Revalidate 1h.
  • npm run lint — same 2 pre-existing errors + 3 pre-existing warnings as master; no new findings.
  • After merge: spot-check production response headers (curl -I https://solidstate.cc/skills) — expect s-maxage=3600, stale-while-revalidate=... instead of s-maxage=31536000.

🤖 Generated with Claude Code

Static pages with no revalidation get s-maxage=31536000 (1 year),
so a CDN can keep serving year-old skill/platform counts after a
deploy that updates lib/skills.ts. Add export const revalidate = 3600
to /, /skills, and /official so the edge TTL caps at one hour.

To allow the home page (which renders STATS) to use route segment
config cleanly, drop "use client" and move the featured-card hover
state to a CSS :hover rule. No other client behavior was used.

Co-authored-by: multica-agent <github@multica.ai>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
solidstate.cc Error Error May 30, 2026 10:50am

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