So I’m creating a stream directory for a site. It’s flow is something like this:
- Curator submits a twitch stream name.
- Stream name is used on the backend to retrieve user details and create a record in the local database.
- User details are used to create a stream up / down notification subscription
- When the stream directory root page is hit I fetch the relational twitch user_ids from the database and use them to retrieve the live streams.
The last point is a bit of a hanging up for because of the limited number of api calls a single client id can make. If I say for example have 30 people all hitting the stream root page at the same time that’s roughly 30 api calls. Some solutions:
- I can cache the result in the backend using redis and clear the cache If I get a stream up / down notification.
My only problem with this is I’m doing server side pagination, which slightly complicates this. I guess I could send all the records and paginate on the client side.
Any suggestions would be appreciated.