WebResource.axd 和 ScriptResource.axd 加载速度非常慢
正常情况下,两个 .axd 文件以正常速度加载到浏览器,即几百毫秒。通过查看 Chrome 或其他调试工具中的瀑布图(网络图),我可以看到它们与所有其他页面元素一起正常加载。
有时会出现某种问题,两个文件需要大约一分钟才能加载。以下是其他一些注意事项:
- 页面上的所有其他元素均以正常速度加载。
- 它通常每天发生一次或两次,持续几分钟。
- 我可以同时看到性能计数器上的请求排队峰值。
- 在此期间CPU、内存和磁盘均保持正常。
- 今天发生了几个小时的中断,需要重新启动应用程序才能解决。
- 尚未合并 .axd 文件或类似文件。
- 在站点范围内实施 URL 重写。 axd 文件不被重写。
- 为 C# 3.5
- IIS 7
- 构建的应用程序
我正在使用 ScriptManager 的 CDN 版本,例如:
看起来其他人也有类似的问题,但没有解决:
WebResource.axd 和 ScriptResource.axd 很奇怪行为
WebResource.axd & ScriptResource.axd 加载时间超过 1 分钟
问题:
知道如何找出导致这两个文件偶尔加载如此缓慢的原因吗?
另外,是否有任何解决方法,例如预构建 .axd 文件或其他东西......?
Under normal circumstances the two .axd files load at normal speeds to the browser, i.e. a few hundred milliseconds. I can see them load normally along with all the other page elements by looking at the waterfall chart (network chart) in chrome or another debugging tool.
Occasionally some kind of issue occurs where the two files take about a minute to load. Here are a few other notes:
- All other elements on the page load at normal speeds.
- It generally occurs once or twice a day and lasts for a few minutes.
- I can see Requests Queued spike on performance counters at the same time.
- CPU, memory and disk all stay normal during this time.
- Had one outage of a few hours today that required an application restart to resolve.
- Not combining the .axd files or anyhing like that yet.
- Have URL rewriting implemented site-wide. axd files are excluded from rewriting.
- App built for C# 3.5
- IIS 7
I’m using the CDN version of ScriptManager, eg:
<asp:scriptreference name="MicrosoftAjax.js" path="http://ajax.microsoft.com/ajax/3.5/MicrosoftAjax.js"></asp:scriptreference>
It looks like others have had a similar issue, but not solved:
WebResource.axd and ScriptResource.axd weird behaviour
WebResource.axd & ScriptResource.axd loading takes more than 1 minute
Question:
Any idea how to figure out what is causing these two files to load so slowly occasionally?
Also, are there any workarounds, such as prebuilding the .axd files or something..?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
也许托管 http://ajax.microsoft.com/ajax/3.5/MicrosoftAjax.js 本地会有帮助吗?
Maybe hosting http://ajax.microsoft.com/ajax/3.5/MicrosoftAjax.js locally would help?
我有一些可能有帮助的建议。
通过设置在发布模式下运行它网络配置
对它们进行测试,看看您的问题是否得到解决。
I have some suggestions that probably help.
Run it on release mode by setting on web.config
Test them to see if your problem go way.
基本上,这些 axd 文件是处理程序,您可能已经知道处理程序代码将由 ASP.net 引擎执行。这些处理程序只是发出一个 js 文件。
我在这里计算出的猜测是应用程序域或工作进程正在回收。检查性能监视器并查看应用程序重新启动计数器以及工作进程重新启动。
Basically, these axd files are handlers, and you may be already aware that handler code will be executed by the ASP.net engine. These handlers simply emit a js file.
My calculated guess here, is that the application domain or the worker process is recycling. Check your performance monitor and take a look at Application Restarts counter along with Worker Process restarts.
如果 .axd 文件是静态的并且不会更改,那么我认为保存它们并将它们引用为 js 文件没有问题。
If the .axd files are static and don't change then I see no problem saving them and referencing them as js files.