Hello!
I have recently been working on a system that reads follower information from the Twitch API. However, I have noticed that this information is not always up to date.
I have been testing by using a second Twitch account to follower my main twitch account. My application has been registered, and I am sending my application Client ID with every request, so I should not be rate limited.
Sometimes I am able to detect the new follower immediately from the API, but other times, I wont be able to see the new follower for multiple minutes. I am also not seeing the API update when checking directly through my web browser by going to: https://api.twitch.tv/kraken/channels/jessewerner/follows
Is there another method I should be using to access live follower information? Is there any reason this would not be up to date for me?
Thanks!
You are probably getting cached data at times, depending upon which node you are pushed to when you hit the API.
Thank you for the quick reply!
I have my request set in my application to disregard the cache on the local machine. Is there a way to make the request to the node to be up to date? I have noticed that other services aren’t having issues detecting my followers live.
Unfortunately, there isn’t a way that I am aware of. In the standard there is no requirement for a server to honor the “no-cache” directive in the HTTP request. I don’t work for Twitch, so I can only comment generally, but I would believe that the followers DB gets a ton of hits and takes time to propagate perhaps at times.
There is also the possibility that there is a caching issue that is occurring at this time, something like that happened to TMI for a couple/few weeks (there were 9-30 minute delays in data) and the Twitch Staff resolved that issue.
/kraken/channel/:login/follows is cached for 5 minutes, and so the data being a couple minutes out of date is expected
It’s not the cache on the local machine at fault as @Fugiman says it’s cached on the server for ~5 minutes.
Most of the Twitch end points have some form of caching on them