Using test.php on your site and Google Chrome?



    About test.php it was already interesting to become a hub But in this small topic I’ll talk about one feature of Google Chrome that can ruin the life of the owners of test.php.

    Working with the next web application, I came across a strange bug: you open the http://example.com/test.php script in Google Chrome , and it runs several times. The reason turned out to be in the standard settings of Google Chrome, and more precisely in the included option “Predict network actions to speed up page loading”.

    Among other things, it allows Chrome to pre-load and render a web page before pressing Enter in the omnibox (address bar), thereby creating the appearance of instant loading. HereThey write that the function works for frequently visited pages (it’s enough just to visit the page at least once to stay in the omnibox history), test.php for developers often fits this criterion :) An

    unpleasant feature of this function is that if the page has time to load before pressing Enter, everything works as it should, and the page is displayed instantly after input. However, if test.php takes longer to load than the time between showing the help in the omnibox and going to the page, after pressing Enter, the page will be reloaded.

    Thus, heavy, long-running scripts (for example, updating the value of a field in a very large database table) can be called several times.

    The solution is simple: in the options, uncheck “Predict network actions to speed up page loading”:



    Perhaps, other modern browsers with a “smart” address bar also have this problem. It is also worth noting that my preload did not appear in the “Network” tab in “Developer Tools”.

    Also popular now: