Skip to content

Commit 9a2fffa

Browse files
ralyodioclaude
andcommitted
site: render /download per request so it cannot freeze on an old release
The download page advertised 0.1.3 and linked to 0.1.3 binaries while install.sh was handing out 0.1.7. Both read the same GitHub "latest" endpoint, so the difference was not the data -- it was when it was read. `export const revalidate` alone makes the page STATIC: Next prerenders it at build time and that HTML ships inside the image, so the version and the download links freeze to whatever was latest when the site was last built. Revalidation regenerates in memory, and a container restart drops back to the baked copy. The site sat on v0.1.3 through four releases that way, and would not have recovered on its own -- only a site rebuild per release would have kept it honest, which couples the site deploy to the release. force-dynamic renders per request instead, so the page is right within an hour of any release with no redeploy at all. The hourly cache on the fetch in latestRelease() still applies, which is what keeps this from turning every page view into a GitHub call: measured 1 API call across 5 views against a production build, so the unauthenticated 60/hr limit is not in play. Verified the built page reports 0.1.7 and links at v0.1.7 assets, and that the route is emitted as dynamic rather than static. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EhwDgBphuy2UKenqMKkezQ
1 parent 7b7f89e commit 9a2fffa

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

apps/web/app/download/page.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,20 @@ export const metadata: Metadata = {
99
alternates: { canonical: '/download' },
1010
}
1111

12-
// Release metadata is fetched server-side and revalidated hourly rather than
13-
// embedded in the client or stored in a database.
14-
export const revalidate = 3600
12+
// Release metadata is fetched server-side rather than embedded in the client
13+
// or stored in a database.
14+
//
15+
// Rendered per request, NOT prerendered. With a `revalidate` alone this page
16+
// is generated at BUILD time, so the version and the download links freeze to
17+
// whatever was latest when the site was last built -- and because that HTML
18+
// ships inside the image, every container restart reverts to it. The site sat
19+
// on v0.1.3 through four releases that way, offering downloads four versions
20+
// old while `install.sh`, which asks the GitHub API at run time, was handing
21+
// out the current one.
22+
//
23+
// The fetch in latestRelease() keeps its own hourly cache, so per-request
24+
// rendering costs a render and not a GitHub call.
25+
export const dynamic = 'force-dynamic'
1526

1627
export default async function DownloadPage() {
1728
const release = await latestRelease()

0 commit comments

Comments
 (0)