SA-MP Forums Archive
SA-MP PHP Api is Slower ?! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SA-MP PHP Api is Slower ?! (/showthread.php?tid=607720)



SA-MP PHP Api is Slower ?! - Metharon - 22.05.2016

Ok i'm working on a php server list for sa-mp..


The problem is i'm using this api: https://sampforum.blast.hk/showthread.php?tid=104299


And is loading the page slower.....


Any ideas how to fix it ?

http://pawno.ro/pawno.ro/etadon/index.php?x=servers


Re: SA-MP PHP Api is Slower ?! - Mauzen - 23.05.2016

Thats because it queries the server on every page load, and this can take some time, especially when its a remote server with a high ping.
You cant "fix" this, but you can work around it. E.g. buffering the data in a database and only querying once in a while can help to speed up page loading times.


Re: SA-MP PHP Api is Slower ?! - Vince - 23.05.2016

Or use AJAX to load asynchronously. Downside is it won't work for people who have Javascript disabled. But that percentile is so small it doesn't really matter.