Faster Json data - PlanetSide Universe
PSU Social Facebook Twitter Twitter YouTube Steam TwitchTV
PlanetSide Universe
PSU: Let's get it on like Donkey Kong!
Home Forum Chat Wiki Social AGN PS2 Stats
Notices
Go Back   PlanetSide Universe > PlanetSide Discussions > PlanetSide 2 API Discussion

 
 
Thread Tools Search this Thread Display Modes
Old 2014-01-04, 05:12 PM   [Ignore Me] #1
SecretSquirrel
Private
 
Faster Json data


as the title says I want to pull data from the API FASTER! I am currently trying to pull data quicker
PHP Code:
$ApiLink "http://census.soe.com/";
$json_decode = (json_decode(file_get_contents($ApiLink), true));
$tada $json_decode***91;"character_list"***93;; 
the above information takes 2.4633 seconds to load, I want to make this happen faster...


Any tips? Thanks!

Last edited by SecretSquirrel; 2014-01-04 at 05:14 PM.
SecretSquirrel is offline  
Old 2014-01-07, 05:52 AM   [Ignore Me] #2
Eggy
Sergeant
 
Re: Faster Json data


Isnt the best way to achieve quicker results to cache the data localy.
Make JSON requests in the background, store the results in your local DB.
The your pages access only your local data.

One other point to mention is that the API was always "slow" and may be slower at the moment due to the anti DoS stuff SOE have put into place over the weekend.
Eggy is offline  
Old 2014-01-07, 10:35 AM   [Ignore Me] #3
Elahhez
Corporal
 
Elahhez's Avatar
 
Misc Info
Re: Faster Json data


Storing a cache locally is what i do anyways, also easy on the load, and what you do with the query data. For our teamspeak and currently online i have a 5 minute cache, mainly to ease on the server load filtering the list.

Another tip is specifying your query, using IDs is quicker than searching.
__________________

Get this or an empire themed dynamic sig with your name on it at http://ps2.gilsweb.com/
Belonging to Long Forgotten Soldiers outfit on Miller, Technology IS Might
Elahhez is offline  
Old 2014-01-22, 10:02 AM   [Ignore Me] #4
Stanis
Master Sergeant
 
Re: Faster Json data


As mentioned : cache the results!
You might want to try a library - see if CURL can make the request faster.

I'm using file_get_contents to retrieve a single file.
However, to speed things up in some scripts I run multiple asynchronous queries using curl_multi_exec()
Stanis is offline  
Old 2014-01-29, 07:43 PM   [Ignore Me] #5
Hamma
PSU Admin
 
Hamma's Avatar
 
Re: Faster Json data


We use curl to fetch the data here on PSU
__________________

PlanetSide Universe - Administrator / Site Owner - Contact @ PSU
Hamma Time - Evil Ranting Admin - DragonWolves - Commanding Officer
Hamma is offline  
 
  PlanetSide Universe > PlanetSide Discussions > PlanetSide 2 API Discussion

Bookmarks

Discord


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 05:48 PM.

Content © 2002-2013, PlanetSide-Universe.com, All rights reserved.
PlanetSide and the SOE logo are registered trademarks of Sony Online Entertainment Inc. © 2004 Sony Online Entertainment Inc. All rights reserved.
All other trademarks or tradenames are properties of their respective owners.
Powered by vBulletin
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.