Hi all

This is a question for those with experience using PHP with BaseX and the rest interface. 

There is a peculiar case of lag for queries, and I wondered if it had to with how PHPdoes things, or if it is how BaseX does things (or if there is something else). This may be a long shot, but I still give it a try.

The setup is fairly straight forward, with queries sent from a html-page via a PHPscript which places the call:

  file_get_contents(basex-rest-URL). 

The result is then sent back to the requesting html page. The problem is that this sometimes hangs: two or three queries then it stops or takes an awful lot of time. 

The peculiar thing is that the basex-rest-URL, when typed directly into browser address line, receives an immediate response, even while it is still being processed by the html-php-basex cycle. Sometimes the cycle gives an answer, sometimes not. The cycle do work when file_get_contents is directed towards an SQLite database, so it seems that there is something going on in the communication between PHP and BaseX.

Any ideas?

Regards
Lars G Johnsen
National Library of Norway