-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve shields.io site performance and load times #1700
Comments
Hi @tooomm Sorry nobody has properly responded to this issue. Performance of the home page is problematic for end users and has caused problems for some upstream services in the past. I definitely think we should look at improving this aspect of the project. Given this issue has a few 👍s clearly others agree. Here's a few thoughts/questions on this topic: It seems like if we make the examples a static badge, there is potential to introduce a kind of duplication or maintenance overhead for the examples i.e: as we change the behaviour of badge code or helper functions, we would have to remember to update the static examples to match (inevitably leading to some 'drift' as the examples don't reflect real world behaviour). If we adopted this approach, can anyone suggest a mitigation? As noted in #1723 there is potential for us to reduce overhead by using CDN/downstream cache. It seems like this might be better to explore first. Regardless of whether the badges are static or dynamic and how well cached they are, we've now got hundreds of images on the front-page of https://shields.io/ and we add services much more frequently than we remove them - this is only going to get bigger. Even if they're all well cached static images, loading hundreds of images generates hundreds of requests. Would we be better to split the examples down into a number of smaller pages with less examples (e.g: seperate pages for 'build', 'downloads', 'version' etc). This would give faster page loads for end users and fewer requests to handle server side. Anyone have further thoughts/suggestions? |
I agree with everything @chris48s said.
I don't have a clear answer on how we would maintain these. One option is a script that re-fetches them from a local dev server at deploy time. Though we'd need a way to handle the failed badges. We could hard-code the badge result in the new-style service. There could still be drift, which I don't love. Finally, another option is to specify mocks along with the hard-coded examples, which would make it easy to re-run them quickly. |
+1 badge generator performance is too slow, badges time out on nearly every request |
I made a start on splitting the site up into smaller pages with examples for 'build', 'downloads', 'version' etc over the weekend. Not ready to submit a PR yet, but just putting a marker down so I'm not duplicating effort with someone else. I'm going to try and work on it some more this week. |
#1808 is now merged which is one of the steps towards this |
#1740 also now merged which allows us to start replacing 'live' examples (which call an API) with 'static' ones as we refactor badges out of |
Lots of improvements were made here, including categories, static examples, and the broader downstream-cache improvements. 🏆 There's some follow-on working which is adding static examples for all the badges. |
Since there are many many badges linked on the shields page, and all of them are freshly generated ones it takes quite a lot of time to receive all replies and finish loading the page.
I mean, it's only supposed to be a preview right?
Why not simply load a static badge instead for each service to show off how it could look like. That would cut down all the generation and request time.
If a user clicks a badge to customize/adjust a particular one in the opening overlay... it could display the real "live" badge on the top there.
The text was updated successfully, but these errors were encountered: