Azure的网站慢为静态JS / CSS但不是二进制 [英] Azure Website slow to serve static JS/CSS but not binary

查看:187
本文介绍了Azure的网站慢为静态JS / CSS但不是二进制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Azure的网站/ Web应用程序是为静态JS和CSS文件慢得令人难以置信,但似乎完全没有服务的二进制文件。

I have an Azure Website/Web App that is incredibly slow to serve static JS and CSS files but seems perfectly fine serving binary.

要测试我上传2 30MB的文件,一个 big.js 和其他 big.rar 的问题。在JS文件下载1​​00KB左右/秒,如果我很幸运。大约4,000KB / s的RAR文件的下载。结果是非常一致的。

To test the problem I uploaded two 30MB files, one big.js and the other big.rar. The JS file downloads at around 100KB/s if I'm lucky. The RAR file downloads at around 4,000KB/s. The results are extremely consistent.

我在提琴手检查和gzip COM pression在两种情况下发生的。正如预期的那样,JS文件正在被使用MIME类型的应用程序/ x-的JavaScript ,而RAR文件被担任的应用程序/八位字节流

I've checked in Fiddler and gzip compression is occurring in both cases. As expected, the JS file is being sent with the MIME type application/x-javascript whereas the RAR file is being served as application/octet-stream.

我在努力理解这一点 - 为什么会成为IIS一种类型的静态内容比另一这么慢得多

I am struggling to understand this - why would IIS serve one type of static content so much slower than another?

推荐答案

我们有这个问题,并能够与Azure支持团队的帮助,以解决此问题。问题是,缓慢的文件将使用TransferEncoding:Chuncked。他们建议,我们强迫静态COM pression来解决这个问题。

We had this issue, and was able to resolve this with the help of Azure Support Team. The issue was that the slow files would use TransferEncoding: Chuncked. They suggested that we force static compression to get around this issue.

我们有以下添加到< system.webServer>

<serverRuntime enabled="true"  frequentHitThreshold="1"  frequentHitTimePeriod="00:00:20" />

这篇关于Azure的网站慢为静态JS / CSS但不是二进制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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