Created by: joe-watkins
Howdy! I've hacked the footer JS a bit to load contributors and GH stats via localStorage in an effort to reduce the individual IP 60 per hour API rate limit.
Here is how it works.
- User lands on page and page load variable is incremented.
- Contributors and Stats are stored into localStorage.
- User reloads/visits another page and if localStorage has contributors set then we load them from there and not the API
- We load from local storage every 20 page loads.
- If user interacts with pagination it pings the API.. no biggie
- After 20 page loads (from localStorage) we ping the API again and it all starts over.
This approach affords the user many more page views and keeps the data fairly accurate. This data doesn't need to be 'down-to-the-second' accurate so I felt we could push some of the lifting to localStorage to help cut down on user rate limits enforced by GitHub.
This should give each user over a 1000 page views per hour which should do the trick :)
Let me know what you think.