Improve platform performance and user experience with optimizations

This commit enhances performance by optimizing video card previews, implementing memoization for categories, debouncing search queries, and enabling compression and caching strategies on the server.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 890577b1-c154-40a4-a177-a0c6d55320c3
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/890577b1-c154-40a4-a177-a0c6d55320c3/dCPgsyV
This commit is contained in:
sebastjanartic
2025-09-02 10:43:58 +00:00
parent 72bded4b3d
commit bddd331745
5 changed files with 49 additions and 26 deletions
+8 -4
View File
@@ -53,11 +53,15 @@ export default function Home() {
}
}, [videosResponse]);
// Only refetch when search changes
// Debounce search to reduce API calls (500ms delay)
useEffect(() => {
if (searchQuery !== undefined) {
refetch();
}
const debounceTimer = setTimeout(() => {
if (searchQuery !== undefined) {
refetch();
}
}, 500);
return () => clearTimeout(debounceTimer);
}, [searchQuery, refetch]);
return (