There are a lot of answers how to preload assets with JS - in parallel or consecutive modes, with AJAX or JS objects, etc. But most of them put pressure on a current connection: if a site has other assets like visible images this approach could have negative impact on site loading.
Is there JS API that implements the same Link prefetching features link tag/header has? To load assets in the moments when a connection is idle, to stop and to restart them. The thing that seems possible to be utilized for these needs is TCPSocket but it is Firefox OS only.
Example: I have 2 types of galleries. The 1st one - Gallery A - with previews of images and the 2nd one - Gallery B - with full-size versions for the same images. While a user is viewing the previews I'm doing standard preloading of the previews for Gallery A. And also I want to add the full-size images from Gallery B to the prefetching queue.