I have developed a Laravel application where I submit an array with base64 data as a payload. In the backend, I don’t interact with the request directly; I simply return a response. However, I’ve noticed a significant delay when submitting the form in the production environment, and this delay seems to be correlated with the length of the array. Surprisingly, when I submit the same payload in my local development environment, I receive an instant response. Is there a way to configure the server to achieve the same level of responsiveness as in the local environment?
I tried to do a live migration of Hypervisor in Digital Ocean to improve the performance, but the issue still persisted.
2
Answers
You are uploading 5 files. Your server and response has to wait for the upload to finish. This will depend on the size of the files and the connection speed.
In localhost the file is just being copied, which is much faster.
What you can do is implement some ajax chunk upload that can upload the files just as you select them and show some progress bar, before you pres the submit button.
Many problems may occur depending on the size/type of data in relation with the parameters below.
Please provide more info:
Run
phpinfo()
in both environments and post the results for the following parametersAlso as already noted by kris localhost is literally the same machine so data upload is near instant, since all of network lag is omitted.