Twitter Tweet Cache Idea (Frontend)

This is a diagram for a system I developed to cache Twitter Tweets in JavaScript for fast loading. The call to fetch tweets from Twitter using oAuth REST API every x seconds with a since_id to prevent getting previously fetched tweets. The tweets are then returned from Twitter and displayed on the page. The load of x initial tweets are loaded and new tweets are loaded when the “x new tweets” button is clicked. There is also an infinite scroll which loads tweets directly from the tweet cache array and when this is exhausted is fetches older tweets from the API using the next_page property provided in the results of the API.