Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A a11yproject.com
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 40
    • Issues 40
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 10
    • Merge requests 10
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The A11Y Project
  • a11yproject.com
  • Merge requests
  • !282

Feature/footer localstorage

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/joe-watkins/feature/footer-localstorage into gh-pages Jun 28, 2014
  • Overview 3
  • Commits 2
  • Pipelines 0
  • Changes 1

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.

  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
  6. 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.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/joe-watkins/feature/footer-localstorage