The open-source AI voice studio. Clone, dictate, create.
fix: prevent stale release data by removing Next.js fetch cache
James Pine9835b9f6d4c2
diff --git a/landing/src/app/api/releases/route.ts b/landing/src/app/api/releases/route.tsindex 60689465..cf10309d 100644--- a/landing/src/app/api/releases/route.ts+++ b/landing/src/app/api/releases/route.ts@@ -2,7 +2,6 @@ import { NextResponse } from 'next/server';import { getLatestRelease } from '@/lib/releases';export const dynamic = 'force-dynamic';-export const revalidate = 600; // Revalidate every 10 minutesexport async function GET() {try {diff --git a/landing/src/lib/releases.ts b/landing/src/lib/releases.tsindex b2847dfe..70baba36 100644--- a/landing/src/lib/releases.ts+++ b/landing/src/lib/releases.ts@@ -18,7 +18,7 @@ const GITHUB_API_BASE = 'https://api.github.com';// Cache for release info (in-memory cache, resets on server restart)let cachedReleaseInfo: ReleaseInfo | null = null;let cacheTimestamp: number = 0;-const CACHE_DURATION = 1000 * 60 * 10; // 10 minutes+const CACHE_DURATION = 1000 * 60 * 5; // 5 minutes// Cache for star countlet cachedStarCount: number | null = null;@@ -36,7 +36,7 @@ export async function getLatestRelease(): Promise<ReleaseInfo> {try {const response = await fetch(`${GITHUB_API_BASE}/repos/${GITHUB_REPO}/releases/latest`, {- next: { revalidate: 600 }, // Revalidate every 10 minutes+ cache: 'no-store',headers: {Accept: 'application/vnd.github.v3+json',},@@ -123,6 +123,7 @@ async function getTotalDownloads(): Promise<number> {const response = await fetch(`${GITHUB_API_BASE}/repos/${GITHUB_REPO}/releases?per_page=100&page=${page}`,{+ cache: 'no-store',headers: { Accept: 'application/vnd.github.v3+json' },},);