Srcset attribute may load larger images on mobile than desktop

A more general fix for all oneboxes has been created:

https://github.com/discourse/discourse/pull/22621

For testing I used articles from this non-wikimedia site: Read the latest Great Reads stories from car lovers like you - Hagerty Media as they had fairly large images to onebox.

Before:

After:

Before this change onebox images were around 400kb. After my change they are around 100kb.

Here is a onebox example which is using the reduced thumbnail size

https://www.hagerty.com/media/car-profiles/driving-the-prodrive-p25-brought-out-my-inner-car-crazy-kid/

4 Likes