为什么Chrome在验证之前调用自动完成的url? [英] Why is Chrome calling the autocompleted url before validation?
问题描述
我在我的网站上使用API发送电子邮件给用户,同时在测试我的电话时,我注意到我收到了两次电子邮件。
看起来像localhost / api / sendEmail
,至少在Chrome上,当我在本地主机上时,我开始输入/ ap
网址会自动完成。
我可以在Fiddler上看到Chrome(我想那就是他)实际上是在我按Enter之前调用它,以便发送邮件,并且当按Enter键时当然是第二次发送。
这不是问题,因为它不会被最终用户直接调用,但我只是想知道什么是这个第一个电话的目的? Chrome是否预先调用页面以加快载入速度?它会在不同的情况下造成问题吗?是否可以阻止Chrome的行为?
同样,这不是一个问题,但我只是想知道。
您可以在 Google Chrome 中停用此选项:
设置>高级设置>隐私:(取消选中)预取资源..
I'm using an API on my website to send emails to the users and while testing my call I noticed I was receiving the email twice.
So the url looks like "localhost/api/sendEmail"
and, at least on Chrome, when I'm on localhost and I start typing "/ap"
the url is automatically completed.
And I can see on Fiddler that Chrome (well I think that's him) is actually calling it before I press Enter so the mail is sent, and when I press Enter it is of course sent a second time.
This is not a problem since it won't be directly callable by the end-user, but I was just wondering what is the purpose of this first call ? Is Chrome pre-calling the page to make it faster to load ? Can it cause problems in different situations? Can one prevent Chrome from behaving like this?
Again, not a problem at all, but I'm just wondering.
This is Google's prefetch
feature, which loads the page quicker, assuming you execute the auto-completed URL.
You can disable this option in Google Chrome:
Settings > Advanced Settings > Privacy: (uncheck) Prefetch resources..
这篇关于为什么Chrome在验证之前调用自动完成的url?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!