AIR seems to keep its own DNS cache when an application is running, and ignores any changes to the OS DNS cache (i.e. ipconfig /flushdns).
More specifically, I'm creating multiple URLStream & URLRequest objects over a long period of time in a AIR application. Once the first one connects the host's IP address is cached for the lifetime of the application. And the URLRequest.useCache property, understandably, has no effect on DNS caching.
Does anyone know if it's possible or how to force a host name to re-resolve inside a AIR (or Flash) application?
Note: Unfortunately, resolving the IP through a web service and rewriting the URL is not an option as a workaround. The use-case is downloading files from Amazon S3 using signed URLs which are invalidated if modified.
Update: The test results above were gathered on WinXP prior to AIR 1.5.2. Subsequent tests using 1.5.2 show serialized requests with URLStream.load() are re-resolved more frequently but still ignore TTL values. I still haven't figured out what conditions are necessary to trigger the re-resolution, but have noted a couple of cases that prevent it. For instance, if another asynchronous URLStream is active to the same host then requests use the cached IP address and are not resolved. And simply closing and dereferencing all streams to a host is not sufficient to ensure the same host name will be re-resolved in the next request.