#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2005
    Posts
    125
    Rep Power
    10

    Ajax bulk or single messages


    Hey everyone,

    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.

    Thanks
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    Normally you would send a request every time a change is made.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2005
    Posts
    125
    Rep Power
    10
    Yeah I was thinking that. Thanks for the tip
  6. #4
  7. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,124
    Rep Power
    4304
    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.
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).

IMN logo majestic logo threadwatch logo seochat tools logo