apache-friend wrote:I'm doing my tests in localhost, so there are no external variables...
I dont mean external servers only, AJAX can send a request to localhost as well and trigger a database request. There might be an issue with database requests, or with DNS resolving, or with the Windows socket or or or. There are so many options why the Apache seems to be slow, that it is still completely impossible to find the reason.
As JavaScript is executed by your browser (you even dont need any Apache server), PHP is executed by Apache and that makes it weird. I am only trying to find any relation between JavaScript and PHP, in order to find a single reason for that behaviour. And a local request via JavaScript to a PHP script on localhost *could* result in a slow delivery of the "remote" PHP script, which seems to look like a slow JavaScript code, but in fact, its the localhost server, which might be slow. Sorry, but i cannot help you any further without going very deep into the source code, which i cannot access.