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
This commit is contained in:
parent
9c889df962
commit
410e8412eb
@ -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 }
|
||||
});
|
||||
|
||||
|
||||
@ -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<VideosResponse>({
|
||||
queryKey: ["/api/videos", {
|
||||
limit: 1000, // Naloži vse videje naenkrat
|
||||
limit: 50, // Naloži samo 50 videev za hitrost
|
||||
offset: 0,
|
||||
search: searchQuery || undefined
|
||||
}],
|
||||
|
||||
Loading…
Reference in New Issue
Block a user