STEEMIT IMPROVEMENTS #1 - Unnecessary API Requests On Blog Page

in #steemit5 years ago (edited)

Steemit is just awesome and I am in love with it. I spend at least 4 hrs a day on it and still can't get the most out of it. Being a developer, I have started analyzing the frontend of STEEMIT and why is it a bit slow comparatively. One thing that I found is the Unnecessary API hits. Without talking more let's get into it.



On Blog Page i.e steemit.com/@username

1. All of the followers' list is fetched and 1000 followers payload at a time. e.g A person having 4500 followers would take 5 API hits to get all the data. 

2. All the people that a person is following and 1000 following people payload at a time e.g A person following 2400 people would take 3 API hits to get the data.

3. An extra API request to fetch the data that I have muted. 

4. The last API that is fired is the people that an account holder has given the access to e.g d.tube, steemauto etc. I don't think we are utilizing its data on the `blog` page.

The same thing goes for any other page which includes the User Profile Information (Header part - name, followers and all) e.g Comments, Replies, Curation Rewards, Author Rewards



Now just think, A normal person uses STEEMIT and opens up his account (steemit.com/@username) 10 times and visits the other 15 person's blogs. If we consider average API hits for followers/following and others is 8 then it would become 8 * 10 + 8 * 15 = 200 which may not seem big but consider 100 people are using it, then it would be 200 * 100 = 20, 000 and now consider 5000 people using it then it would become 5000 * 200 = 1,000,000 (1 Million). These many requests are absolutely going to waste. This is the case when we are only considering the normal person using it. Now think of some hardcore STEEMER, its alone number would be 1000-2000. 

Also, I am talking about these numbers just for the BLOG page, it happens on the pages that I have mentioned above. The actual number must be very high than what we have computed.

These API hits can be avoided which requires a very small change. More than 50% of the data or network payload is wasted because we do not need/show this data on "blog" page. e.g I just need the count of the followers and following which we already got in a separate API and we don't need to fetch all the followers and following list at all. This is an absolute overhead.

In addition, these followers/following list must be loaded only on the pages where the user is actually seeing the list and not anywhere else.  


As STEEMIT will grow with time, we will have to think about every aspect of the product. We can't let any stone unturned in order to become a market leader. It has to look professional, robust and most importantly user-friendly. 

Thanks for reading, If you have find any value in reading my blog then please share and upvote.


Coin Marketplace

STEEM 0.28
TRX 0.12
JST 0.032
BTC 69731.54
ETH 3810.82
USDT 1.00
SBD 3.84