Online list page too slow

My page open too slow, 63 seconds.

In this page i’m printing a list of channels online from a database list of 130 channels with views and game, the channels has divided to two table. One for affiliate channels, one for non-affiliate channels.
I’m printing api with cUrl and refresh online list with js div reload on 5 seconds.

What am I doing wrong?

If your page is poking the API every page load. You are doing it wrong.

You should use a background task via CRON to update status into a database table.
And your webpage serves from that database table instead of direct calling the API.

As then if two people loads the webpage, you are not making double the number of requests, you are just loading from your database

Quindi dovrei fare un cron che scarica le informazioni che mi servono e le salva nel database e poi dal database me le stampo nella pagina, corretto?

Yes

Ops, i’m replied in my language ahahah sorry

s’all good. I google translated

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