Jack
Jack

Reputation: 951

php Symfony 3 ajax call not async

I am using php Symfony 3 on my site and when I try to make a long ajax request, it blocks my site from operation with my browser. It means that I even cannot retrieve a page from another browser tab until request is done. On another server, which is written on pure php there is no such issue (I can open another page from my site when ajax call is pending). I thought this would be a mod_rewrite issue, but dont know how to check it. Are there any ideas how to fix it? Thank you.

UPD_1 I came across THIS question and now if the issue is with session file lock, how it could be fixed in Symfony 3 environment? Thank you

Upvotes: 2

Views: 666

Answers (1)

albert
albert

Reputation: 4468

Close your session in your controller.

public function yourAjaxAction() {
    $this->get("session")->save();
    ...
}

This will make your session readonly and you will be able to do another requests. Only do that on the requests that does not need to update your session.

Upvotes: 4

Related Questions