Skip to content

fix(seo): cache the sitemap for hours and close the games launch review - #62

Merged
kris1027 merged 5 commits into
mainfrom
feat/games-launch-review-nits
Oct 27, 2026
Merged

kris1027 merged 5 commits into
mainfrom
feat/games-launch-review-nits

Conversation

@kris1027

Copy link
Copy Markdown
Owner

What

This follows up on the fresh model review of the games launch (PR #61). A complete sitemap is now cached for hours, not days, so the IGDB game ids in it stay within Twitch's 24 hour caching limit. The share image doc comments now say the image can come from TMDB or IGDB. G10 and spec 0032 are marked done and accepted.

Why

The review in docs/reviews/2026-10-27-feat-games-launch.md raised two minor findings:

  1. PR feat(games): launch games, indexable with IGDB credit and no flag #61 moved the genre and platform caches to hours because the Twitch Developer Services Agreement limits a cached copy of IGDB data to 24 hours (spec 0032, AC-11). But the sitemap's outer cached scope, which now holds IGDB ids, still lived for days.
  2. The image doc comments in lib/seo/metadata.ts still said TMDB only, though the game page passes IGDB art.

Spec 0032 AC-7 is amended to record the hours lifetime, and spec 0016 (which first set days) carries a matching amendment.

Changes

Sitemap cache lifetime

  • app/sitemap.ts: when every read succeeds, cacheLife("hours") replaces cacheLife("days"). A partial list still lives for minutes. The JSDoc says why.
  • app/sitemap.test.ts: the AC-8 test now expects [["hours"]] and points to spec 0032 AC-11. This also fills the coverage gap the review named (nothing asserted the outer cacheLife for a complete list).

Doc comments

  • lib/seo/metadata.ts: SITE_CARD_PATH, CatalogMetadataInput.image, siteCardUrl and shareMetadata now say "TMDB or IGDB" or "catalog image".
  • lib/seo/AGENTS.md: the sitemap cache rule says hours and gives the reason.

Specs, scope and records

  • Spec 0032: Status set to Accepted, a 2026-10-27 amendment, AC-7 rewritten, a "caches for hours" test line, and the scope link updated to the done anchor.
  • Spec 0016: a 2026-10-27 amendment, with days changed to hours in AC-8, the response table, the value sourcing table and build plan step 6.
  • Spec 0032 verify.md: the AC-12 (no flag) and AC-15 (production launch) checks are ticked.
  • docs/scope/games.md: G10 set to done, with Build, Verify and Review ticked.
  • New: the review record docs/reviews/2026-10-27-feat-games-launch.md.

How to test / verify

  • You can run pnpm test. Then app/sitemap.test.ts should pass "keeps a complete list for hours" (cacheLife called once with "hours") and the existing "minutes" case on a failed read.
  • You can also run pnpm typecheck and pnpm lint.
  • Optionally, build with VERCEL_ENV=production NEXT_PUBLIC_SITE_URL=<url> pnpm build and open /sitemap.xml. It should still list games in the same order. Only the cache lifetime changes.

Risk & rollout

Low risk, no migrations, no flags. The only runtime change is a shorter cache on /sitemap.xml, so it is rebuilt more often. That means a few more TMDB and IGDB reads per day, which share cache entries with the landings. The other review nits (metadata.ts:114 wording, the footer logo alt, the parseSearchParams JSDoc, the navbar-search.tsx comment wrap) are left as they are.

Notes for reviewers

  • The review also points out that a prerendered sitemap is frozen until the next deploy. This PR does not touch that note in lib/seo/AGENTS.md.
  • In the new popularTitleIds JSDoc in app/sitemap.ts, one line runs past the usual wrap width. A rewrap would be a cosmetic follow up.

🤖 Generated with Claude Code

kris1027 and others added 5 commits October 27, 2026 10:02
…hour cache rule

The list now holds IGDB game ids, so a days lifetime outlived the Twitch
Developer Services Agreement's 24 hour caching clause that spec 0032 AC-11
applied to every other IGDB read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The game page passes IGDB art to catalogMetadata and shareMetadata, so the
comments on their image fields no longer name TMDB alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d accept 0032

The sitemap holds IGDB ids, so a complete list lives hours to stay inside
the 24 hour caching clause; 0016 notes the change to its AC-8. G10 is done,
so 0032 moves to Accepted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kris1027 kris1027 added bug Broken behavior or regressions docs Documentation additions and updates test Automated tests and test infrastructure labels Oct 27, 2026
@kris1027 kris1027 self-assigned this Oct 27, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in BeStats Oct 27, 2026
@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
bestats Ready Ready Preview Oct 27, 2026 9:11am UTC

@kris1027 kris1027 moved this from Backlog to In review in BeStats Oct 27, 2026
@kris1027
kris1027 merged commit eb6104e into main Oct 27, 2026
4 checks passed
@kris1027
kris1027 deleted the feat/games-launch-review-nits branch October 27, 2026 09:13
@github-project-automation github-project-automation Bot moved this from In review to Done in BeStats Oct 27, 2026

This branch was successfully deployed

1 active deployment
Preview — 659e00e7 Deployed Oct 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Broken behavior or regressions docs Documentation additions and updates test Automated tests and test infrastructure

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant