From 410e8412eb1b3bdf5134e35ef526d46ec2bd2c81 Mon Sep 17 00:00:00 2001 From: sebastjanartic <45803536-sebastjanartic@users.noreply.replit.com> Date: Sat, 30 Aug 2025 21:41:17 +0000 Subject: [PATCH] Improve page loading speed by reducing fetched video data Optimize video fetching by limiting the number of videos loaded per request on the home and Folx Stadl pages from 1000/200 to 50. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 051a65da-1176-4478-a61c-c662f2a15536 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/051a65da-1176-4478-a61c-c662f2a15536/9NQBiz8 --- client/src/pages/FolxStadlPage.tsx | 2 +- client/src/pages/home.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/pages/FolxStadlPage.tsx b/client/src/pages/FolxStadlPage.tsx index 3a8f762..ff0ad0d 100644 --- a/client/src/pages/FolxStadlPage.tsx +++ b/client/src/pages/FolxStadlPage.tsx @@ -19,7 +19,7 @@ export default function FolxStadlPage() { const itemsPerPage = 10; const { data, isLoading } = useQuery<{videos: Video[], total: number}>({ - queryKey: ['/api/videos?limit=200'], + queryKey: ['/api/videos?limit=50'], select: (response) => response || { videos: [], total: 0 } }); diff --git a/client/src/pages/home.tsx b/client/src/pages/home.tsx index 9b9f27e..9083784 100644 --- a/client/src/pages/home.tsx +++ b/client/src/pages/home.tsx @@ -24,10 +24,10 @@ export default function Home() { - // Fetch videos with aggressive caching for speed + // Fetch videos with optimized loading const { data: videosResponse, isLoading, refetch } = useQuery({ queryKey: ["/api/videos", { - limit: 1000, // Naloži vse videje naenkrat + limit: 50, // Naloži samo 50 videev za hitrost offset: 0, search: searchQuery || undefined }],