What is the setback on having to many ajax running. I have more than 5 setIntervals with different time to run, calling ajax, to update html or just check the session is alive. Is this good? some run every second, some every 5 minutes or so. what is the best way to do this.
Share
I would personally stray away from that kind of approach, rather, I would look into a push alternative or combining all of your ajax requests into one. This can lead to a server strain if this is a high traffic site. Also, if this is for someone on dialup or on a mobile device, this will most likely destroy the client’s connectivity.
I don’t know anything about the project, so I don’t know if pushes would work, if you have a trigger that runs when new data is available, I would check out pubnub.com and look into push.
If that isn’t a viable solution, I would recommend making one script that responded with all the information that your script needed, all in one request. This reduces server strain.
Best of luck!