views:

294

answers:

3

I just posted the question how-to-determine-why-the-browser-keeps-trying-to-load-a-page and discovered that my problem is with Gravatar.

I also noticed that StackOverflow is suffering from the same outage.

Does anyone know of a graceful way to determine if Gravatar, or any third party website for that matter, is up or not, before trying to retrieve avatar icons from them?

This would eliminate the long page load and the never ending busy cursor ... I shouldn't say never ending ... it just takes a long time to go away and is very confusing to the user as they sit there and wait ... for nothing.

+3  A: 

You can have a different process that is periodically checking the status of the site. Set a rule about what is down for you, for instance you could say: "ping time > 1500 ms = down". Have this process to leave a note in a database table or config file. Then you check this value on each page rendering at almost no cost.

Depending on how critical is this external site, you can do the check more or less often.

This process could be an out of the web stack program, or a page only accessible through localhost that gets executed via Scheduled Tasks or an ASP.NET facility like mentioned in the comments.

Vinko Vrsalovic
Or you could do it in the web stack. And have it repeat every so often, by having a cache object timeout.
Kibbee
A: 

In an effort to minimize the number of applications and database tables, would there be any major performance issues trying to do this right in the asp.net web form? And is this even possible?

mattruma
It would be self defeating, you would have to wait for its answer...The next best thing would be to do it, instead of out of the web stack, in a separate page enabled only from localhost that you can access via scheduled tasks or other scheduler (don't know if IIS has one)
Vinko Vrsalovic
That's what I figured ... thanks for the answer!
mattruma
+1  A: 

For Gravatar you can cache all theses images instead of taking them from their server everytime. Of course, if user change their icon, it might not refresh as fast as it would be if it were direct access to the main server but at least you do not have to request gravar server everytime.

Daok