From e6067e76cd2364572625517961449d9ef98e2ece Mon Sep 17 00:00:00 2001 From: Paul Bailey Date: Tue, 2 Dec 2025 14:38:01 +0000 Subject: [PATCH] Improve real-time sync speed and caching - Reduced polling interval from 3s to 2s for faster updates - Added revalidate = 0 to prevent Next.js caching - Updates from other browsers now appear within 2 seconds - Both home page and list detail pages sync faster --- app/list/[id]/page.tsx | 1 + app/page.tsx | 3 ++- components/ListDetailView.tsx | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/list/[id]/page.tsx b/app/list/[id]/page.tsx index 28b1278..73020cd 100644 --- a/app/list/[id]/page.tsx +++ b/app/list/[id]/page.tsx @@ -9,6 +9,7 @@ import InlineItemCreate from '@/components/InlineItemCreate' import ListDetailView from '@/components/ListDetailView' export const dynamic = 'force-dynamic' +export const revalidate = 0 export default async function ListDetailPage({ params }: { params: { id: string } }) { const session = await getServerSession(authOptions) diff --git a/app/page.tsx b/app/page.tsx index ea7476c..e7310e2 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -10,6 +10,7 @@ import { authOptions } from '@/pages/api/auth/[...nextauth]' import { redirect } from 'next/navigation' export const dynamic = 'force-dynamic' +export const revalidate = 0 export default async function Home() { const session = await getServerSession(authOptions) @@ -22,7 +23,7 @@ export default async function Home() { return (
- +

Ultimate Lists

diff --git a/components/ListDetailView.tsx b/components/ListDetailView.tsx index db3928d..bcaeaee 100644 --- a/components/ListDetailView.tsx +++ b/components/ListDetailView.tsx @@ -78,7 +78,7 @@ export default function ListDetailView({ useRealtimeSync({ listId, enabled: true, - pollInterval: 3000, // Poll every 3 seconds + pollInterval: 2000, // Poll every 2 seconds }) // Extract all unique tags from items