0

HTML5 Prefetching is a great tool and in the past it's provided a users with a much better user experience when navigate image galleries. Though, in this case I can't seem to get my images to preload properly. When I view the network tab in Chrome dev tools I see that of the GET requests are processed but under status they are listed as (canceled) & type is "Pending".

Any idea why these requests would get canceled?

I'm using a basic PHP for loop to iterate through a JSON array to retrieve the image paths you can see that here:

 <?php foreach($this->slideShow as $key => $value ) {?>
    <link rel="prefetch" href="<?= $value->mainImage ?>">
 <?php } ?>

Here is an example of what is returned when the above loop runs:

<link rel="prefetch" href="http://cdnl.mysite.com/mp/620/400/leadimage1.jpg">
<link rel="prefetch" href="http://cdnl.mysite.com/mp/620/400/leadimage2.jpg">
<link rel="prefetch" href="http://cdnl.mysite.com/mp/620/400/leadimage3.jpg">
<link rel="prefetch" href="http://cdnl.mysite.com/mp/620/400/leadimage4.jpg">
<link rel="prefetch" href="http://cdnl.mysite.com/mp/620/400/leadimage5.jpg">
HjalmarCarlson
  • 868
  • 2
  • 17
  • 34

1 Answers1

0

The prefetches are cancelled because the developer tools are opened. If you use the chrome://net-internals tool, you'll see that they succeed when the dev tools are closed. The cancelled prefetches are noisy, but nothing is wrong.

mattbasta
  • 13,492
  • 9
  • 47
  • 68
  • 1
    why would they be canceled because the devtools were opened? what is the logic in that? – vsync Dec 28 '16 at 17:02