Preloading question

Preloading Question: Happy Monday Tyler :slight_smile:
My page has very little content on it and the followup-page the user will most likely request will force the browser to load a large amount of content.
Therefore I was thinking it might be a good idea to use the idle time to prefetch some of the data the followup page will request.

Can you think of a neat way to preload a large html page in advance in the background, (or parts of it?)

I tried to inject an iframe dynamically on window.onload, with some extra settimeout , but that did not work out very well. I think the anymod system cannot distinguish between the content of the small page, and the content (pre-)loaded inside of the iframe , as both are on the same domain. Also I fear some conflicts with the draft version. Plus: anymod seems to disregard (overwrite) the display none Value I provided for that iframe, so I dropped this approach and decided I should better ask you about this first .

Can you see a smart way to prefetch some of the content the followup-page will request? I would like to load the data before the user actually clicks onto the large-page-url and thus the browser starts to request the data.

The approach you mentioned should work: just load the next page in an iframe after a small timeout. That would cause the browser to download and cache all of that page’s assets.

You may need to make the iframe “visible” (eg 1px x 1px with opacity = .01) for the browser to actually load the page.

Okay, that is what I did. Great. Ps: the hidden conent seemed to have loaded with the dispay none setting as well

Great :grinning:. That may be dependent on browser, I am not sure what the spec is for that.

Yes, me neither. You are right, I only had chrome in mind but my customer runs on FF (as I found out today:) It is always good to know which devices the customer is using :slight_smile: