January 22nd, 2013, 04:36 AM
Ajax bulk or single messages
I've recently been working on a web application much like a task list app. Currently I updated the server once in a while with all the changes the user has made. Eg the current state of the form. I was wondering is this a good idea or is it better to send smaller messages more frequently when a user adds or deletes tasks etc? Whats the common practice?
My way seems to work ok but I think I can see problems with it. I just thought sending heaps of little messages would create a traffic bottleneck.
I was just wondering what everyone else does.
January 22nd, 2013, 08:32 AM
Normally you would send a request every time a change is made.
January 23rd, 2013, 01:29 AM
Yeah I was thinking that. Thanks for the tip
January 23rd, 2013, 03:10 PM
I'd say it depends. What's the maximum number of AJAX requests per minute (per user) that this could generate and how many users do you intend to able to support at the same time? For example, if you have 10 or more requests per minute per user and over 100 users, that's quite a lot of requests. In such a situation you may want to use ("HTML5") localStorage to reduce the number of requests, and then on a less frequent schedule you can send the data saved in localStorage to the server.