Skip to content

The one and only agent harness for complex codebases. Project memory, planning, execution, and verified completion inside Codex.

fix(web): avoid caching star fallback

YeonGyu-Kimc51bc2e43655
diff --git a/packages/web/app/api/github-stars/route.ts b/packages/web/app/api/github-stars/route.ts
index 971631aa..03e58eac 100644
--- a/packages/web/app/api/github-stars/route.ts
+++ b/packages/web/app/api/github-stars/route.ts
@@ -6,7 +6,7 @@ export const dynamic = "force-dynamic"
export const revalidate = 60
const LIVE_CACHE_CONTROL = "public, s-maxage=60, stale-while-revalidate=300"
-const FALLBACK_CACHE_CONTROL = "public, s-maxage=30, stale-while-revalidate=120"
+const FALLBACK_CACHE_CONTROL = "no-store"
type GitHubStarsFallbackPayload = {
readonly stars: number
diff --git a/packages/web/e2e/github-stars.spec.ts b/packages/web/e2e/github-stars.spec.ts
index 92cd0b96..755cf9c4 100644
--- a/packages/web/e2e/github-stars.spec.ts
+++ b/packages/web/e2e/github-stars.spec.ts
@@ -1,3 +1,5 @@
+import { readFileSync } from "node:fs"
+import { join } from "node:path"
import { expect, test } from "@playwright/test"
import {
fetchGitHubStars,
@@ -85,4 +87,10 @@ test.describe("github stars live source parsing", () => {
expect(parseShieldsStarsPayload({ message: "2.5k" })).toBe(2_500)
expect(parseShieldsStarsPayload({ message: "invalid" })).toBeUndefined()
})
+
+ test("does not cache static fallback responses", () => {
+ const routeSource = readFileSync(join(process.cwd(), "app/api/github-stars/route.ts"), "utf8")
+
+ expect(routeSource).toContain('const FALLBACK_CACHE_CONTROL = "no-store"')
+ })
})