|
|
|
|
|
by jazzyjackson
2754 days ago
|
|
I'm playing around with an HTML-only page where I want to load lots of resources in iframes, couldn't find much guidance on the web on how bad of an idea this might be (I seem to remember being told each iframe has a similar overhead as a new tab, since it is a whole other browsing context) Does 25 iframes cause any slowdown? Do you have any tips to keep performance up, like setting display=none to iframes out of view ? I'll test all this soon, I just would appreciate any knowledge you've gained along these lines :) |
|
Take a look at my repo for how it's implemented; it is not the most responsive site in the world.
What I can tell you is: 1) display=none is a good idea 2) Certain sites have the HTTP header 'X-Frame-Options': BLOCK' or something along those lines. Modern web-browsers wont render those pages in iframes 3) It's a good idea to add sandbox="allow-forms allow-scripts" on every iframe to stop top-level redirects.
I have noticed that it is quite heavy, and my phone's browser handles this for me under-the-hood by saving pages to disk when the iframe is collapsed (I think. I haven't actually tested this but the performance would suggest that this is the case.)