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
This commit is contained in:
2025-12-02 14:38:01 +00:00
parent 78bfcb7ac3
commit e6067e76cd
3 changed files with 4 additions and 2 deletions

View File

@@ -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)

View File

@@ -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 (
<main className="container mx-auto px-4 sm:px-6 py-6 sm:py-8 max-w-7xl">
<RealtimeUpdater pollInterval={3000} />
<RealtimeUpdater pollInterval={2000} />
<div className="flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4 mb-6 sm:mb-8">
<h1 className="text-2xl sm:text-3xl lg:text-4xl font-bold text-gray-900">Ultimate Lists</h1>
<div className="flex items-center gap-3">