You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Within OpenSource, calling the getProjects function hits the API about 3-4 times each minute due to the way that revalidation works and the fact that getProjects uses paginate which wraps multiple api calls in one if there are more than 100 repositories within ACM.
Inside the main page of index.tsx, the only place that we use a project is to randomly feature a project, and there's no need for us to hit the getProjects function there. Instead, I propose that we store a couple projects that we want to highlight inside a JSON array, and randomly choose from that list as opposed to from the entire list of acm's projects.
To get their info to put into the JSON array, you can call the github api to grab that data to put into the array!
Additionally, something that we want to do is to add in failsafes for if the Octokit API goes past the rate limit. Maybe we can use the repository fixtures as a failsafe if we hit the API rate limit as opposed to simply having the website crash?
Within the projects page, we prob don't need to revalidate the projects every 60 seconds, we can prob change the revalidate to be done daily! For the index.tsx, we can keep it as revalidate 60 for events but we no longer want to call the getProjects() function which does multiple hits to our endpoint.
The way that revalidation works is that it revalidates ALL the props associated with the page every interval. If you want to read more about it, you can check it out within the revalidate link I provided up above!
The text was updated successfully, but these errors were encountered:
Within OpenSource, calling the
getProjects
function hits the API about 3-4 times each minute due to the way that revalidation works and the fact that getProjects uses paginate which wraps multiple api calls in one if there are more than 100 repositories within ACM.Inside the main page of index.tsx, the only place that we use a project is to randomly feature a project, and there's no need for us to hit the
getProjects
function there. Instead, I propose that we store a couple projects that we want to highlight inside a JSON array, and randomly choose from that list as opposed to from the entire list of acm's projects.Some projects that we can initially highlight are Cyber's CTF Platform, TeachLA's Editor, and Hack's HOTH website.
To get their info to put into the JSON array, you can call the github api to grab that data to put into the array!
Additionally, something that we want to do is to add in failsafes for if the Octokit API goes past the rate limit. Maybe we can use the repository fixtures as a failsafe if we hit the API rate limit as opposed to simply having the website crash?
Within the projects page, we prob don't need to revalidate the projects every 60 seconds, we can prob change the revalidate to be done daily! For the index.tsx, we can keep it as revalidate 60 for events but we no longer want to call the getProjects() function which does multiple hits to our endpoint.
The way that revalidation works is that it revalidates ALL the props associated with the page every interval. If you want to read more about it, you can check it out within the revalidate link I provided up above!
The text was updated successfully, but these errors were encountered: