a11yproject/a11yproject.com — pull request #282 by joe-watkins (2014-06-28 19:29:15+00:00)
Title: Feature/footer localstorage

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.
1. User lands on page and page load variable is incremented.
2. Contributors and Stats are stored into localStorage.
3. User reloads/visits another page and if localStorage has contributors set then we load them from there and not the API
4. We load from local storage every 20 page loads.
5. If user interacts with pagination it pings the API.. no biggie
5. 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.