Setup retries for SSR/CSR
- All my api calls are GET to pull data from my CMS. We don't invalidate/refetch. The staleTime is Infinity. If user wants to get "fresher" data they need to reload the page, easy.
- We use ky and tanstack query.
- In our current app, ky is setup as retry FALSE, and queryClient retries as 3.
Questions:
We're moving to SSR as much as we can for SEO purposes so basically our api calls would happen JUST on the server.
1) Do we need to setup ky to retry 2/3 because this will happen on the server? And if the api calls we want the retry on the server.
2) any recommended approach for this use case where our staleTime is infinity but if there is an error fetching data on the server we want to retry to send a html with data.