Multiple access from same browser

Hi guys,

Is somebody have the same problem of me?
I need to launch multiple quite long ajax request to my CakePHP 3.9. I would like them to execute in parrallel mode but, as it was the same browser (i guess the same session), Apache queue them and the request are executed sequentially. Is there any apache ou php or cake parameter to change to do that?

PS : Excuse my poor english, i’m french …

It’s likely not Apache causing it, but PHP, as PHP’s default session file locking behavior blocks concurrent requests, eg only one request can access the session at a time.

You can improve this by for example manually closing the session once you are sure that you do not need it anymore. If applicable, moving long running tasks to a background queue might be even better.

You might be tempted to switch your session backend to a non-locking one, but be aware that non-locking and non-blocking are two very different things! The former will very likely cause race condition problems, and I don’t think the latter really exists in the PHP space.

Just a suggestion. You can have another domain pointing to the same server & cakephp. Then call your ajax to the other domain. But you will need to take care of Cross-Origin Resource Sharing (CORS) if that error appears. pointing to cakephp#1 pointing to cakephp#1