简体   繁体   English

Express Angular App无法在ie9中提供资产

[英]Express angular app not serving assets in ie9

I have an angular/express application. 我有一个angular / express应用程序。 It works fine in all browsers but when testing IE9 I am getting 304/Aborted on all of my assets. 它在所有浏览器中都可以正常工作,但是在测试IE9时,我的所有资产都被304终止了。

<link rel="stylesheet" type="text/css" href="css/vendor/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="css/vendor/font-awesome.min.css" />
<link rel="stylesheet" type="text/css" href="css/raw/alertWrapper.css" />
<link rel="stylesheet" type="text/css" href="css/raw/df-alerts.css" />
<link rel="stylesheet" type="text/css" href="css/raw/df-app-loader.css" />

please note that the root is actually "/app" so app/index, app/css, etc.... 请注意,根目录实际上是“ / app”,因此是app / index,app / css等。

i am using app.use(express.static(__dirname + '/app')); 我正在使用app.use(express.static(__dirname + '/app'));

I am seeing this in IE: 我在IE中看到了这一点:

ie9资产未加载

Notice the http:///css ..... 注意http:/// css .....

The status code 304 actually means "not modified". 状态代码304实际上表示“未修改”。 This happens when the browser sends a request for a file and indicates that it has a cached version (using conditional headers like If-Modified-Since or ETag based ones). 当浏览器发送文件请求并指示其具有缓存版本时(使用条件标头,例如If-Modified-Since或基于ETag的条件标头),就会发生这种情况。

If the cache contents of the browser are up to date, the server responds with a status code of 304 and some headers only and the browser is expected to abort the connection and serve the local content. 如果浏览器的缓存内容是最新的,则服务器将以状态代码304和仅某些标头进行响应,并且浏览器应中止连接并提供本地内容。

So without further information, your app most likely works as expected and the problems you're having with IE have a different cause. 因此,如果没有更多信息,您的应用程序很可能会按预期运行,而IE出现的问题可能是由不同原因引起的。

So apparently IE9 has limits the amount of stylesheets you can load. 因此,显然IE9限制了您可以加载的样式表的数量。 I was loading about 50 or more. 我加载了大约50个或更多。 I reduced to 4 and the problem went away. 我减少到4,问题消失了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM