I have a new AIR app about to launch and it needs to check for internet connection when it runs. I have read through all of the Adobe tutorials, Tour de Flex tuts, watched Adobe videos, etc. And it seems simple BUT I have some concerns that are not addressed anywhere that I have found.
1) Every Adobe example seems to say that I should set up URLMonitor to run continuously. That is quite convenient for my app but seems terribly wasteful in bandwidth. If I only need to know about connectivity once an hour am I not wasting bandwidth by "hitting" the URL continuously over that hour? Also, am I not filling my server logs with useless "hits" during that same period?
2) Related to the above, some of the Adobe examples show the use of www.Google.com. In one Adobe video Daniel Dura says, "We create a new URLRequest and in this case I'll just use Google.com because that's the easiest thing to use"! Is this not a MAJOR problem when my app gets extremely popular and thousands of users are hitting Google continuously? I guess I should know better than to use Google but I'm concerned about my own bandwidth and Adobe says its OK so...
3) To reduce the bandwidth used I have considered setting URLRequest method as "HEAD" which seems to me to be the proper approach since I don't really need to resource I'm getting, I'm just checking to see if it is available. But Rick Winscot points out (http://www.quilix.com/node/26) that some servers like Amazon.com do not allow HEAD requests and fail with a 405 MethodNotAllowed.
4) Another point Rick makes is that some servers do not return the error message and instead return 200 along with a healthy serving of spam!
So, I guess I have concluded that a) it is VERY BAD to use anyone's server in the URLMonitor other than my own and b) I need to be extremely careful that I do not add significant "traffic" to my website and useless hits to my server logs.
I have tentatively come up with the following plan,
-set up a special page on my server that will only be requested by my AIR app; that way I can filter it out of my server logs
-only use HEAD in the URLRequest; that way I can reduce bandwidth as much as possible
-start the URLMonitor immediately before I need to check status and then stop it ASAP after status is confirmed; that way I eliminate unnecessary hits on my server
I guess I have two questions...
1) are my concerns valid or is the overall effect of using URLMonitor as advertised negligible?
2) if its not negligible is my approach sound and complete?
Thanks in advance for any thoughts, ideas, discussion, etc.!