Characters skills (and other informations)

Added by etar about 9 years ago

For the Characters API, there is currently only 3 ways to get informations : Full, Partial, items.

Is there any possibility to retreive others informations (mainly skills) faster than retrieving the full XML ?
For the moment, for each character, the full XML takes 0.9s (average) to be retrieved. When we need to get informations from 30 or 40 characters, this will take a while to display the page...

For the moment, I use it with a cache system (retrieving Full XML and storing them for 1 hour) on my side but I'll need to update this cache (each hour) and it will alse always get a long time.

Waiting for your answers,
Sheep'


Replies (7)

RE: Characters skills (and other informations) - Added by nimetu about 9 years ago

Racawan wrote:

For the Characters API, there is currently only 3 ways to get informations : Full, Partial, items.

ohh noo... not another split for xml data. it's bad enough that 'full' does not give items and i need to do two requests hehe.

For the moment, for each character, the full XML takes 0.9s (average) to be retrieved. When we need to get informations from 30 or 40 characters, this will take a while to display the page...

For the moment, I use it with a cache system (retrieving Full XML and storing them for 1 hour) on my side but I'll need to update this cache (each hour) and it will alse always get a long time.

caching is easy and you can run cache update script every minut if you like.

first you select expired keys from database. if there is none, you done ;-)
then you download and update the cache for each key that is expired.

save the little script to 'cron.php' for example and call it from server side cron jobs, your own computer cron job that 'pings' the cron script over web etc.

RE: Characters skills (and other informations) - Added by etar about 9 years ago

This is quite the way we are caching XML files. This is not a problem, but caching a chached informations is not fine for all servers (and devs ;)), this is not "proper".

I don't want to split informations, but to be able to retrieve a partial information, with only the part I need. The items should be in the "full" AND the "items" XML files... not only in one.
Retrieving 40 XML files, that takes 0.9s each, is not a good way to develop,

And the API informations says :

Get all information (bigger file, use it only if you really need specific information that exists only in this profile).

That means that items info must be inside (so this is a wrong information) and that means that this is not recommended to use it... (too big)

RE: Characters skills (and other informations) - Added by nimetu about 9 years ago

Racawan wrote:

This is quite the way we are caching XML files. This is not a problem, but caching a chached informations is not fine for all servers (and devs ;)), this is not "proper".

ask yourself, why do you download the info from off site and spend 0.9sec waiting for it if you know the info has not changed from the last download ?

0.9sec contains the network 'ping' too, but most probably it's taking so long because server is a bit busy answering all those websites that think it's their local database ;-)

RE: Characters skills (and other informations) - Added by etar about 9 years ago

That's why we installed a real local cache system. We are not considering the API as a local DB. :/
But taking more than 30s each hour to retrieve updated informations, just for one website, I'm not sure this will be fine for the API host.

I was requesting to have the possibility to retrieve only the necessary XML informations, not only for "my personal problem", but also to be sure to don't flood the API.
I'm not sure that if 50 websites request every hour 30 full characters informations, the API host will appreciate.

RE: Characters skills (and other informations) - Added by Nanowish about 9 years ago

One idea for get only usefull informations is of retrive specified node only.

For retrive skills node only and all subnodes in <skills> </skills>: character.php?key=FR521366R0REA16F998&node=skills

If xml contains same many node like pet or log can select all with :
character.php?key=FR521366R0REA16F998&node=pet

can select only first pet node
character.php?key=FR521366R0REA16F998&node=pet&index=1

Make some nodes can selected only with parent node, like <position /> child node of <pet /> node. Because position node for player conflict between position's node pet.

sorry for my english

RE: Characters skills (and other informations) - Added by etar about 9 years ago

That was a good idea, but server is still sending the whole full XML. The "node" argument is not used by the server side.

No problem for your english, but I know your french is better ;)

RE: Characters skills (and other informations) - Added by Nanowish about 9 years ago

Racawan wrote:

That was a good idea, but server is still sending the whole full XML. The "node" argument is not used by the server side.

Sure, this idea is for dev can add node argument for API server side if read this thread :D

(1-7/7)