Comments (3)
When there is a lot of traffic to the Heroku server, the GitHub API seems to stop sending back content and the responses become very slow. If it takes too long to load, GitHub will just show a broken image instead of waiting. GitHub also caches responses on their server, so even if the speed gets back to normal, it could still show as broken on GitHub for a particular image URL for up to a few hours.
To avoid this issue, I recommend self-hosting the project. There are steps in the readme, I recently added a new method for deploying with Vercel entirely online. It's free and shouldn't take more than a couple minutes to set up.
It should also start working on its own, but there isn't much I can do to prevent it from going down in the future, so self-hosting is still an option to get it to stay up more reliably.
from github-readme-streak-stats.
When there is a lot of traffic to the Heroku server, the GitHub API seems to stop sending back content and the responses become very slow. If it takes too long to load, GitHub will just show a broken image instead of waiting. GitHub also caches responses on their server, so even if the speed gets back to normal, it could still show as broken on GitHub for a particular image URL for up to a few hours.
To avoid this issue, I recommend self-hosting the project. There are steps in the readme, I recently added a new method for deploying with Vercel entirely online. It's free and shouldn't take more than a couple minutes to set up.
It should also start working on its own, but there isn't much I can do to prevent it from going down in the future, so self-hosting is still an option to get it to stay up more reliably.
@DenverCoder1 why not set up caching on the backend? Instead of calling the GitHub API on every request, you can cache a user's stats for a few hours and have it clear itself automatically, that way the number of calls do the GitHub API should reduce dramatically. Yes, the PNG won't pick up your new streak immediately until the cache invalidates, but this should be much better than GitHub showing a broken image. Considering how lightweight and simple this project is, I don't think you'd even have to use Redis or something similar for caching, just a regular hashmap and it should work fine (unless you're running multiple instances on the heroku server that is).
from github-readme-streak-stats.
Thanks for the suggestions, @XiovV.
I believe that GitHub is caching the images, but even with that, the server is overloaded with new requests. We have cache control headers set to tell servers to use cached versions for up to an hour. Maybe increasing this to be a few hours could help.
Only 1 instance is running on Heroku (using a Basic dyno formation). There is no persistent storage, but an external service could be used for caching if necessary, though.
from github-readme-streak-stats.
Related Issues (20)
- Does Private Repos count in Streak? HOT 2
- Card is slightly higher than github-readme-stats cards.
- Count Back From Zero When Open It Before Commit Anything
- Unable to deploy on Vercel HOT 7
- Wrong Date/Zero Streak Bug HOT 2
- Streak Issue HOT 4
- Separe Location and Idiom HOT 3
- My streak count changed from 118 to 89 after I generated a new personal access token HOT 1
- Vercel Deployment fails due to error loading php shared libraries HOT 2
- Meta theme
- Streak Templete not showing HOT 13
- When used with hide_border=true it shows the error Failed to retrieve contributions. This is likely a GitHub API issue HOT 4
- Dynamic theme change (Dark or Light) HOT 2
- Add Dark-Minimalist theme HOT 2
- Inaccurate Issue
- Inaccurate Streak HOT 1
- Streak Issue
- Inaccurate streak stats not fixed HOT 1
- Issue in the stats generation and demo page HOT 4
- Bug `excluded_days` when using it inside `<picture>` HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from github-readme-streak-stats.