4 ms·
Isn't infinite scrolling a memory hog?
by 72deluxe 12y ago
Isn't infinite scrolling a memory hog?
- acdha 12y agoIt's a risk but implementers can take the sting out of it. Browsers aren't currently smart enough to do things like unload decoded <img> memory for things which aren't visible but you can avoid the worst of it if you use a CSS background-image (which browsers do unload) and a visibility test on scroll to avoid loading things which aren't visible or soon to be visible. This works as far back as IE8 so it might be worth the hassle.
- 72deluxe 12y agoThank you - very informative. I would not have known the behaviour of browsers with regard to that - is there an established standard or accepted behaviour documented somewhere? I'm guessing that the CSS spec only dictates how things should be shown and not what browsers can do with off-screen items.
- acdha 12y agoCorrect: the only way to know for sure is to test it. I think a few minor extensions could make that a lot easier – e.g. a CSS :visible selector and support for background-image: attr(…)
- 72deluxe 12y agoThank you. The massive amount of testing is surely what hampers web development? Years ago in the dark ages people dreamed of cross-platform apps; the three main players in this market (desktop only) now are Windows, Mac OSX and Linux (to a tiny extent). Writing a cross-platform native app is no longer a massive exercise in frustration (see wxWidgets or Qt). Someone thought Java would solve all our problems, but it seems to have fallen out of fashion, and everyone pins their hopes and dreams on cross-platform apps with websites, but surely the effort is far larger: testing on 3+ browsers per OS at least! I don't see how everyone copes.