Preload the contents of the external website, then redirect

When you leave the site, my user receives a message that you are leaving now, which redirects after 4 seconds. Can this time be used to preload the contents of the target site, so that after redirecting the site appears faster?

+3
source share
2 answers

If a site is selected in your domain, you can parse the next file using JavaScript and request assets.

If not, you cannot determine its assets (not through XHR anyway, most of the time), so you cannot preload them. You can hack it by placing the site in hidden iframe. You can also use your server as a proxy to get a list of assets and transfer it to your HTML to start preloading.

You can also try using this tag meta...

<link rel="prefetch" href="/images/big.jpeg">

Source .

This is a lot of effort, maybe not so much though.

+5
source

You can start loading the site into invisible <iframe>. If it is cached properly, this will reduce the load time when the user actually enters the page.

, , , , .

- (/ prefetch, @alex!)

+3

All Articles