Replies: 1 comment
-
Since you cannot be 100% sure on server-side, you'll need help from client-side. Look into the javascript event https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am building a literature search website with the latest stable release of Symfony.
Sometimes, if the user selects a lot of keywords and research filters, the server may process the request for quite a while. The issue is, if the user cancels their request (by clicking on the cross icon on their web browser), the server will keep processing their request. Which means, if they send another request, it'll be queued and will have to wait for the previous one to be finished.
That's a bit of a problem and there seem to be a few workarounds in vanilla PHP. However, I haven't seen this issue raised anywhere on Symfony.
So is there any way for me to actually detect (in a loop) that the user has closed the connection with the server, and then abort the request?
Beta Was this translation helpful? Give feedback.
All reactions