civictechindex / CTI-website-frontend

Join a worldwide movement to catalog 
every open source 
civic tech project.
https://civictechindex.org
MIT License
30 stars 30 forks source link

Too many API requests from frontend #1115

Closed fyliu closed 2 years ago

fyliu commented 2 years ago

Describe the bug Too many API requests from frontend. It made 3 requests to the backend and 3 to Github. Some of them are duplicates. Some might not be necessary for the organization details page, like https://api.civictechindex.org/api/organizations/ which I think gets the list of all organizations.

To Reproduce Steps to reproduce the behavior:

  1. Go to http://civictechindex.org/organization/code-for-chapel-hill
  2. Open the browser dev tools to the Network tab. Set view filter to Fetch/XHR. Clear any outputs
  3. Press F5 to refresh the page
  4. See the calls that were made

Expected behavior Maybe one call to the backend and one call to Github.

Screenshots Network tab screenshot Screenshot from 2022-01-07 14-35-54

Desktop (please complete the following information):

Additional context I was seeing this message after refreshing the page around 5 times and wondering if I reached the Github API limit. "We are experiencing technical issues. Please try again later."

bruceplai commented 2 years ago

This should be resolved in the fix for #1113 The search repo query has been combined into one string rather than sending multiple queries to github