Ajax difference between requests

83 views Asked by At

Imagine you have big application (like facebook or G+) with tons of ajax short polling.

you have sidebar with news feed (which does not update quite often), you have notifications, you have online users and etc.

Now usually what you do it make a spearate ajax requests for each of this (at least this is what I've done)

Now I want your opinion about merging this requests together and retriving them as JSON. so let separate functions handle it's own data.

What do you think, which is the right way? Sending many requests or retriving high bandwith data?


I really like to merge my requests but never seen such requests, and I have some cons: for example consider case when this ajax calls ar merged into one, and all of them had information. It's not only will be high bandwith (havy) but also will take some time to update DOM, and maybe force browser to glitch. also javascript will take longer

should I worry about this? Can you think about other scenario, why it's bed?

0

There are 0 answers