如果服务器发生故障,请使用超时嵌入脚本 [英] Embedding script with timeout in case server goes down

查看:45
本文介绍了如果服务器发生故障,请使用超时嵌入脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种方法来确保外部脚本文件不会阻止查看的页面,
如果服务它的服务器关闭" (例如,由于某些原因端口80被阻塞).

I am looking for a way to make sure an external script file won't block the viewed page,
if the server which serves it is "down" (for example port 80 is blocked for some reason).

当前,当我通过手动关闭服务器(Apache)进行测试,或通过服务器的防火墙阻止该文件时,我看到浏览器试图加载资源(在这种情况下为脚本),但长时间没有成功,直到资源中止.

Currently when I test by taking down the server (Apache) manually, or block that file via server's firewall, I see the browser is trying to load the resource (script in that case), without success for long period of time, until it aborts.

有办法解决这个问题吗?

Is there a way to get past this issue?

推荐答案

史蒂夫·苏德斯(Steve Souders)的最新文章分析了此问题:

A recent post from Steve Souders analyzes this problem : Frontend - Single Point of Failure, by browsers and type of failure

这篇关于如果服务器发生故障,请使用超时嵌入脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆