Open dogzipp opened 15 years ago
Polling is necessary to get the uploaded file size in near real time. But perhaps a throttle setting would be a nice addition.
I understand. I am just trying to avoid getting hammered with so many request, sometimes about 10 per second. One every second or two, could still be near real-time and be healthier for the web server.
As far as I understand, there's really no "pause" command on Javascript, so a trick would need to be used to cause the script to pause a while between ajax requests.
There is a pause built in. It's two-part.
1) after the previous ajax call is returned, the counter animates (lasts .2s) 2) after the animation, the next call is done ( in essence, a .2s timer)
That 0.2s should be a setting instead of hard-coded. Then, you'd be able to have a 1s timer instead.
Would it be possible to have the JS not poll my server with 100 ajax requests a minute? hehe.
Perhaps some kind of delay can be put on the JS, so the actually ajax polling could be done once every second or something like that.