Chrome - 多个请求 [英] Chrome - multiple requests

查看:322
本文介绍了Chrome - 多个请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我使用chrome向我的webapp发送一个GET请求时,根据我的apache访问日志发送两个相同的请求(并非总是,但大多数时候,我无法再现它 - 它不适用于favicon)发送尽管只有一个显示在chrome开发工具中。我停用了所有的扩展功能,但仍在发生。



这是 https:// news。 ycombinator.com/item?id=1872177 是真的,它是一个铬的功能,或者我应该深入挖掘我的应用程序中找到该错误?

解决方案

我认为这比这更糟糕。我在这里的体验(使用Google App Engine开发)是Chrome正在提出各种额外请求。



这可能是由于设置中的选项,默认检查:


  • 预测网络操作以改善网页加载效果



这是一个非常奇怪的例子:我的网站页面每隔15秒运行一次通知检查(在javascript中完成)。即使在关闭与我的网站相关的所有标签后,我也会看到来自我的IP,一些随机页面的请求以及通知检查请求。对我来说,这意味着Chrome有一个我的网站页面在后台运行,甚至评估它的JavaScript。



当我请求一个页面时,我几乎总是得到另一个页面请求该页面中的链接之一。并且它还请求额外页面的资源(.css,.js,.png文件)。

我看到了与本地运行的开发服务器相同的行为。



还会发生来自另一台计算机/网络。
在Firefox中不会发生。



另请参阅使用chrome发送额外请求怎么办?


Whenever I send a GET-request to my webapp using chrome, according to my apache access log two identical requests (not always, but most of the times, I can't reproduce it - it's not for the favicon) get send to the sever, although only one is shown in the chrome dev tools. I deactivated all extensions and it's still happening.

Is this https://news.ycombinator.com/item?id=1872177 true and is it a chrome feature or should I dig deeper within my app to find the bug?

解决方案

I think it's even worse than that. My experience here (developing with Google App Engine), is that Chrome is making all kinds of extra requests.

This is possibly due to the option that is in the Settings, checked by default:

  • Predict network actions to improve page load performance

Here is a really weird example: my website's page runs a notifications check every 15 seconds (done in javascript). Even after closing all tabs related to my website, I see requests coming from my IP, some random pages but also the notification check request. To me that means that Chrome has a page of my website running in the background and is even evaluating its javascript.

When I request a page, I pretty much always get another request for one of the links in that page. And it also requests resources of the extra pages (.css, .js, .png files). Lots of requests going on.

I have seen the same behavior with the development server that runs locally.

Happens also from another computer / network. Doesn't happen with Firefox.

Also, see What to do with chrome sending extra requests?

这篇关于Chrome - 多个请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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