From 0e9d3c570e7c2910e2b0a030546a7eb535dc061e Mon Sep 17 00:00:00 2001 From: Local Administrator Date: Wed, 3 Jun 2026 13:29:54 +0000 Subject: [PATCH] fix(avbeat): noStore() on homepage so hero actually re-renders MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dynamic='force-dynamic' + revalidate=0 on the page weren't enough because FeaturedBentoFromDb -> pickAds() -> fetch in src/lib/ads.ts:98 sets next:{revalidate:30}. Next.js takes the lowest positive revalidate from the render tree and opts the whole route into 30-second ISR (visible in .next/prerender-manifest.json: '/' initialRevalidateSeconds: 30), masking the page-level force-dynamic directive. unstable_noStore() called at the top of the HomePage component body forces an unambiguous, child-tree-overriding opt-out so the Telycam hero swap (and any future DB-driven hero change) renders on every request. lib/ads.ts caching is left alone — its revalidate is fine for ad rotation; we just stop it from poisoning the page-level cache. --- src/app/home-page/page.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/app/home-page/page.tsx b/src/app/home-page/page.tsx index 0e1b539..7cd3be7 100644 --- a/src/app/home-page/page.tsx +++ b/src/app/home-page/page.tsx @@ -1,5 +1,6 @@ import React, { Suspense } from "react"; import type { Metadata } from "next"; +import { unstable_noStore as noStore } from "next/cache"; import Header from "@/components/Header"; import Footer from "@/components/Footer"; import FeaturedBentoFromDb from '@/components/FeaturedBentoFromDb'; @@ -137,6 +138,14 @@ function FeedSkeleton() { } export default function HomePage() { + // Hard opt-out of all caching for this route. Without this, a child + // server component (FeaturedBentoFromDb -> pickAds -> fetch in lib/ads.ts + // with `next: { revalidate: 30 }`) pulls the whole page into 30-second + // ISR — Next.js takes the lowest positive revalidate it sees in the tree + // and ignores `dynamic = 'force-dynamic'` at the page level. noStore() + // is the unambiguous, child-tree-overriding opt-out and is what the + // hero swap needs to render fresh on every request. + noStore(); return (
{/* Sticky top bar + nav */}