Increase speed of the new API

I would like to know if there is any method to increase the speed of the new API, so that the page loads faster, I am using native PHP and I use the curl_init function.

Thank you

If there’s a speed issue it’s your server talking to Twitch or something between the two.

The best advice is to cache what you can, for example, if you looked up a streams live status, it won’t have changed in the last minute or so (due to Twitch Server caching) so you should fetch the live stream status, store it on your server in database/flat file/redis cache or something, and load from there.

Update the DB/FF/RC using a CronJob, then your website page loads don’t have to wait for Twitch, you can even utilize Twitch Webhooks, so Twitch tells you when a stream goes live/offline, rather than fetching yourself.

You could even load your page, then Javascript will call a API you make on your server, that fetches the Twitch data, so it doesn’t block the initial page load

Thanks for the advice, I have already applied it

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.