A few months ago, @Johani released an excellent theme component to lazy load images. This means images are only loaded as they scroll into view, rather than being loaded as soon as they appear anywhere on the page, even if they aren’t visible to the user yet.
This is a great thing to have on forums where topics have many images in them, especially for users on connections with limited bandwidth.
If you know some of the more technical details of Discourse, you might ask, hey @eviltrout doesn’t Discourse already kind of do this? You do infinite scrolling and posts are streamed in and out of memory as the user scrolls. Yes, that’s right! But we generally do so in “chunks”, and on some image boards a single post could have dozens of large images. Why load them all at once when they aren’t visible yet?
In the latest builds of Discourse, we now lazy load large images, no extra components or plugins are necessary. If you scroll really fast you’ll see a blurry low-res version of a large image as a placeholder. It’ll look something like this:
technical details: we generate a very, very small 10x10 32-color image and store it as a data URI in the post, which the browser scales to the correct size – this ends up being around ~300 bytes
It’ll soon be replaced by the correct image:
We will continue to tweak the feature over the next little while, so please provide feedback and notes if you have them!