The stupid question is the question not asked | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Previously, I was putting our external mirrors in an array called @mirrors, and rendering the page based on: $mirrors[rand @mirrors]/file.tar.bz2 This breaks down when one of the mirror sites is either down, offline or inaccessible. I'm rewriting the entire site, and wanted to do this in a more-intelligent way, by checking if the remote mirror is accessible before I write those links into the page for the end users. I can do this by using LWP and a HEAD request, checking $response->status_line; for a 200 response code like this:
I'd like to take that one step further, and present the user with the FASTEST server hosting our releases. In Debian, there is a tool called 'netselect', and another one that uses it called 'netselect-apt'. The combination of these will pick the fastest Debian mirrors to your current location, and build a sources.list file for you. Is there some way to do this with LWP or other magical incantations? Some method that will check the array for the fastest response time, and use that entry over any others? In reply to Selecting the "fastest" server listed in an array by hacker
|
|