Fix stale catalog counts via ISR revalidation (SOL-4)#6
Open
VisionaireLabs wants to merge 1 commit into
Open
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
/,/skills,/official) had norevalidateset, so Next.js emitsCache-Control: s-maxage=31536000(one year). Whenlib/skills.ts(orlib/clawhub.tsvia the weekly cron) changes and Vercel ships a new build, a CDN can still serve year-old counts until its own TTL expires.export const revalidate = 3600to those three pages. The build output now shows them asRevalidate: 1h, Expire: 1yinstead of fully static. After the next deploy, the edge can hold at most one hour past the rebuild."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 inlineonMouseEnter/onMouseLeaveto a.ss-featured-card:hoverCSS 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 gets-maxage={revalidate}, stale-while-revalidate=...— exactly what we want.Test plan
npm run build— succeeds; output table confirms/,/skills,/officialare now ISR with Revalidate1h.npm run lint— same 2 pre-existing errors + 3 pre-existing warnings asmaster; no new findings.curl -I https://solidstate.cc/skills) — expects-maxage=3600, stale-while-revalidate=...instead ofs-maxage=31536000.🤖 Generated with Claude Code