Improve data freshness on the home page by always fetching new information
Update query options in the home page component to disable caching (staleTime: 0, gcTime: 0) and enable background refetching on window focus and reconnection. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 2eb1084e-b728-4449-9231-f1665924c8d5 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/2eb1084e-b728-4449-9231-f1665924c8d5/BiCW5yE
This commit is contained in:
parent
bbe9afe48f
commit
3e1220da4e
@ -43,10 +43,10 @@ export default function Home() {
|
|||||||
}
|
}
|
||||||
return response.json();
|
return response.json();
|
||||||
},
|
},
|
||||||
staleTime: 5 * 60 * 1000, // 5 minutes
|
staleTime: 0, // No caching - always fresh data
|
||||||
gcTime: 10 * 60 * 1000, // 10 minutes
|
gcTime: 0, // No cache retention
|
||||||
refetchOnWindowFocus: false,
|
refetchOnWindowFocus: true,
|
||||||
refetchOnReconnect: false
|
refetchOnReconnect: true
|
||||||
});
|
});
|
||||||
|
|
||||||
// Update videos when new data comes in
|
// Update videos when new data comes in
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user