什么会导致页面被取消?我有一个Chrome开发者工具的截图。
这种情况经常发生,但不是每次都发生。似乎一旦缓存了一些其他资源,页面刷新就会加载LeftPane.aspx。真正奇怪的是,这只发生在谷歌Chrome浏览器中,而不是ie8。知道为什么Chrome会取消一个请求吗?
什么会导致页面被取消?我有一个Chrome开发者工具的截图。
这种情况经常发生,但不是每次都发生。似乎一旦缓存了一些其他资源,页面刷新就会加载LeftPane.aspx。真正奇怪的是,这只发生在谷歌Chrome浏览器中,而不是ie8。知道为什么Chrome会取消一个请求吗?
当前回答
Chrome版本33.0.1750.154米一致取消图像加载,如果我使用移动仿真指向我的本地主机;特别是用户代理欺骗(相对于屏幕设置)。
当我关闭用户代理欺骗时;图像请求没有被取消,我看到了图像。
我仍然不明白为什么;在前一种情况下,当请求被取消时,请求头(注意:显示的是临时头)只有
接受 cache - control 编译指示 推荐人 用户代理
在后一种情况下,所有这些因素加上其他因素,比如:
饼干 连接 宿主 接受编码 接收语言
耸耸肩
其他回答
当我在样式表中嵌入web字体时,我已经嵌入了所有类型的字体以及woff, woff2, ttf。最近我注意到Chrome取消请求ttf和woff时,woff2是存在的。我现在使用Chrome版本66.0.3359.181,但我不确定Chrome什么时候开始取消额外的字体类型。
对我来说,这是一条错误的道路。我建议调试的第一步是看看你是否可以加载文件独立的ajax等。
另一件要注意的事情可能是AdBlock扩展,或一般的扩展。
但“很多”人有AdBlock....
为了排除扩展,以隐身方式打开一个新标签,确保你想测试的扩展“允许隐身”是关闭的。
内容安全策略头为我!你可以通过检查Chrome开发工具控制台来快速排除这种可能性,如果是CSP问题,控制台中会显示错误。在。net中,你可以通过在web中添加头部来解决这个问题。配置文件或代码。
拒绝将表单数据发送到“https://www.mysite.mydomain/”,因为它违反了以下内容安全政策指令:“表单-操作'自我' *。otherdomain www.thirdparty.co.uk”。
这是网络。以上错误的配置修正:
< cspConfiguration > < directives > <指示 < /指令> < / directives > < / cspConfiguration >
I had the same issue when updating a record. Inside the save() i was prepping the rawdata taken from the form to match the database format (doing a lot of mapping of enums values, etc), and this intermittently cancels the put request. i resolved it by taking out the data prepping from the save() and creating a dedicated dataPrep() method out of it. I turned this dataPrep into async and await all the memory intensive data conversion. I then return the prepped data to the save() method that i could use in the http put client. I made sure i await on dataPrep() before calling the put method:
等待dataToUpdate =等待dataPrep(); http。把(apiUrl dataToUpdate);
这解决了间歇性取消请求的问题。