A
A
Alex Art2020-06-16 10:23:28
PHP
Alex Art, 2020-06-16 10:23:28

Why does the site not open until another page of the site opens?

Hello! There is such a situation that on the page of the site, after opening it, a heavy ajax request is made to the server to obtain a lot of additional data. It runs for about 5-10 seconds and it is not possible to speed it up. And I noticed that until it is executed, it is impossible to go to another page of the site or open it in a new tab until this request is completed. That is, the rest of the pages will be loaded until this heavy ajax request is completed. And this applies only to the user for whom the request is being made. This request does not slow down other users of the site. That is, it is somehow tied to a specific user session so that he cannot perform more than 1 request at the same time. The server is a regular debian with a standard ISPManager installation. Tell me please, is it possible to somehow force the server to process multiple requests of one user at the same time and how? Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rsa97, 2020-06-16
@WebmasterW3S

Once a session is opened via session_start, the session file is locked until the script terminates or the session is terminated via session_abort, session_commit, or session_write_close.
If your heavy script doesn't need session data until the very end, you can simply close the session immediately after using the session data.

I
Ilya, 2020-06-16
@New_Horizons

Session lock.
https://www.php.net/manual/ru/features.session.sec... The
easiest way would be to put a heavy request in the background, and just run it using Ajax and periodically check the status.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question