ASP.NET MVC:无法完全加载网页。 IIS 似乎截断或拒绝“大”文件从慢速客户端请求页面时的图像
我已经为一个无法解决的问题苦苦挣扎了一个星期。
我有一个无法从外部访问的网站。它只能从 Intranet 或通过 VPN 连接可见。
在某些网页中,我根据某些变量加载图像,以便使用 Html.RenderAction 来加载这些图像。
该网站通过我设置的 VPN 运行良好(由于服务器的原因有点慢)。
但上周我尝试从远程客户端站点运行该 Web 应用程序,但它的一些页面未在任何浏览器(IE8、Chrome 或 Firefox)中加载。它只加载页面的一部分,但随后加载“大”图像时就会卡住。
我已经检查过 Fiddler 和 Firebug。
Fiddler 显示浏览器正在正常加载页面,但是当它尝试通过 Html.RenderAction 加载 145kb 的图像时,Body 列的值为 -1(空?),并且还显示了如何浏览器尝试多次重新加载相同的页面。
Firebug 还在该页面中显示错误,我收到一条消息,内容为“图像损坏或截断:websiteaddress/GetImage?Id=123”,
看起来人们没有在那里使用互联网(午餐)例如,时间),页面加载没有问题。 我也无法理解,浏览器如何尝试重新加载页面,而不是让 jpeg 半加载并继续加载其余组件(例如复选框等)。
我尝试删除此 Html.RenderAction 并且网页加载正常,直到它尝试加载另一个包含 pdf 格式的 ssrs 报告的页面(我假设该文件也大于 145kb)。
有什么帮助吗?
多谢。
I have been struggling for a week with an issue I haven't been able to sort out.
I've got a website that is not accessible from outside. It is only visible from the intranet or through VPN connection.
In some of the web pages, I am loading images depending of some variables so that I use Html.RenderAction to load these images.
The website runs fine from a VPN I've got set up (a bit slow because of the server).
But last week I tried to run the web app from a remote client site and a few of its pages didn't load in any browser (IE8, Chrome or Firefox). It only loads part of the page, but then it gets stuck loading the 'large' image.
I have checked with Fiddler and Firebug.
Fiddler shows that the browser is loading the page fine, but when it tries to load an image of 145kb through Html.RenderAction, the Body column has value -1 (null?) and it also shows how the browser attempts to reload the same pages several times.
Firebug also shows an error within that page, I'm getting a message that says 'Image corrupt or truncated: websiteaddress/GetImage?Id=123'
It looks like when people is not using Internet there (lunch time, for example), the page loads without problem.
I cannot understand as well, how comes the browser attempts to reload the page instead of leaving the jpeg half loaded and keeping on loading the rest of components such as checkboxes and so.
I've tried to remove this Html.RenderAction and the web page loads fine, until it attempts to load another page where there is a ssrs report in pdf (I assume the file is bigger than 145kb as well).
Any help?
Thanks a lot.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试更改
You could try changing the request/response timeout settings in IIS, although it may be that the machine serving these images is not up to the task and is falling over - in which case your best bet is to either reduce the size/number of images it serves, or upgrade the machine (or distribute some resources somewhere else)