We currently use AmplifyJS to handle all AJAX requests in combination with pub/sub for updating models and storage for caching etc.
It works wonderful except in the following conditions:
- you have a slow network connection or a slow overloaded server.
- the user keeps clicking, adding a lot of stacked requests on top of the already running requests.
- at a certain point Chrome and Firefox turn unresponsive with CPU load approaching 100%. From this point on all processing is getting very slow and you have to kill the process eventually.
You can easily reproduce these conditions using Gremlins.js or any other frontend load testing script.
A plain jQuery post works fine. It is Amplify that causes these issues. I searched the documentation but I couldn't find a way to either:
- throttle the requests
- abort all running requests when a new request is started.
Am I missing something? Can you please point us in the right direction?
Thanks a lot!
Yuri