I came across an interesting problem. I am using Symfony2. A simplified task is as follows. There are two actions, each of which has a path in routing.yml. The first action does the following:
return new \Symfony\Component\HttpFoundation\Response("first");
The second action does the following:
$start = time(); while(time()-$start < 25); return new \Symfony\Component\HttpFoundation\Response("second");
The second action starts the loop for 25 seconds and then returns.
I call the second action: domain.com/second (of course, it takes time to download), meanwhile I open another browser window and type: domain.com/first. This should give me the result in the blink of an eye, however, even the first action waits for the second to finish, and they will give me the result at the same moment. This happens both in development mode and in production. I assume that the two processes should work independently. If instead of the first action I call a pure PHP script (and not Symfony), it immediately returns without waiting. In addition, if I run the first and second actions in different browsers, I do not need to wait for the first download.
What could cause the problem? The problem outlined above has been simplified to understand, however, if this had been resolved, my original, more complex task also worked.
Thanks for the help: David
source share