Closed erin-fitzpatric closed 1 week ago
Hey I can work on this one
I added a last commit, I wanted to impelment a retry logic in the Get querry but I found it easier to just retry when fetching the call every 500ms
I have a PR up that changes reddit post to SSR instead of client browser via useEffect. there should be no need for cache as page's default caching strategy will apply
Reddit posts are currently fetched directly from the server, rather than via a request to the API layer. https://github.com/erin-fitzpatric/next-aom-gg/blob/main/src/server/fetchRedditPosts.ts
In next.js, all routes created in the
/api
become a severless function when deployed to vercel https://vercel.com/docs/functionsapi/reddit/route.ts
I think the cache could be set to 1 hour, but this is open for discussion. Seems like a reasonable refresh rate and will help cut down on requests every someone hits the home page.