0

We are developing a website that will run on 5 different sub-domains throughout Asia.

When a client comes to the site, they can find the best server to connect to in relation to them. So this will need to be done on the client. So I guess javascript is the only option.

I was thinking to have a small image on each server which the client can download via ajax and then we can work out the response times (we do have server access). I know this isn't ideal, but can't really think of anything better.

  • 2
    Wouldn't it be better to just have your site on a certain domain, and handle server selection server-side? The time spent determining which server is faster is better spent loading the site in the first place. – Cerbrus Sep 06 '17 at 08:37
  • 3
    Seems others have liked that idea: https://stackoverflow.com/questions/4282151/is-it-possible-to-ping-a-server-from-javascript – DanteTheSmith Sep 06 '17 at 08:38
  • Just make sure you read the top comment on the solution as well to prevent caching the image. – DanteTheSmith Sep 06 '17 at 08:39

0 Answers0