3 ms·
Ya due to the way getting acess to this works, theres a 10 minute cache of active streams that get expired in redis and a cron job pulls in a fresh list
by mumphster 6y ago
Ya due to the way getting acess to this works, theres a 10 minute cache of active streams that get expired in redis and a cron job pulls in a fresh list
- the_duke 6y agoIf you are not already, you could use the GraphQL API that the web app uses, which provides sorting by viewers ASC. That would allow for much more up to date results than iterating the full list with the official API. Not sure how happy Twitch is about external users, but it can be accessed quite easily with some tinkering.
- mumphster 6y agoThis is exactly what its doing, albeit caching results, somce im trying to be nice. Official api sadly does not allow sorting by asc.
- VectorLock 6y agoHopefully they're cool about it. Typically companies like this frown upon ersatz API usage and cache/rehosting of their data.
- riteshpatel 6y agoIs there a reason for a 10 minute cache duration? Even 1 minute would be fine from a performance point of view
- mumphster 6y agoSo I'm not hitting the api too much, this is going through a roundabout way to get this data