Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Chrome calling the autocompleted url before validation?

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.

like image 808
deonclem Avatar asked Jun 04 '14 11:06

deonclem


1 Answers

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..
like image 140
nickjag Avatar answered Sep 20 '22 21:09

nickjag