From ccb36e484e91713c996be6da30ce56b9ffc34782 Mon Sep 17 00:00:00 2001 From: sebastjanartic <45803536-sebastjanartic@users.noreply.replit.com> Date: Wed, 3 Sep 2025 14:44:42 +0000 Subject: [PATCH] Improve video data refresh rate for better performance Adjust the refetchInterval for view counts from 30 seconds to 2 minutes in VideoPage and Home components to optimize data fetching and reduce potential load. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 2cd2c0bc-434c-4bc9-ad3f-b99d3897a0d1 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/2cd2c0bc-434c-4bc9-ad3f-b99d3897a0d1/gjpMN2A --- client/src/pages/VideoPage.tsx | 4 ++-- client/src/pages/home.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/pages/VideoPage.tsx b/client/src/pages/VideoPage.tsx index 120ed36..33badbb 100644 --- a/client/src/pages/VideoPage.tsx +++ b/client/src/pages/VideoPage.tsx @@ -75,8 +75,8 @@ export default function VideoPage() { enabled: !!videoId, retry: 3, retryDelay: 1000, - // Real-time refresh for view counts - refresh every 30 seconds - refetchInterval: 30000, + // Real-time refresh for view counts - refresh every 2 minutes for better performance + refetchInterval: 120000, refetchOnWindowFocus: true, refetchOnReconnect: true, }); diff --git a/client/src/pages/home.tsx b/client/src/pages/home.tsx index 50f5707..b4ae45d 100644 --- a/client/src/pages/home.tsx +++ b/client/src/pages/home.tsx @@ -44,8 +44,8 @@ export default function Home() { gcTime: 10 * 60 * 1000, refetchOnWindowFocus: true, refetchOnReconnect: true, - // Real-time refresh for view counts - refresh every 30 seconds - refetchInterval: 30000 + // Real-time refresh for view counts - refresh every 2 minutes for better performance + refetchInterval: 120000 }); // Update videos when new data comes in