Open
Description
Related to #6177 and #6131 and #11821 . Filed as separate issue because #6177 is getting too big.
Problem
If a user uploads an unoptimized image, maybe directly from a digital camera, that image file may end up being sent to the visitor browser causing a significant performance hit. For example, this happens when the viewport or displayed width of an image matches or exceeds the original uploaded image width as the original image is the largest image in the srcset
attribute array.
Solution
- Always create a new optimized version of the original image matching the original dimensions of the uploaded image.
- Add the optimized version of the original image as the largest image file available in
srcset
array. - Never load the original uploaded image unless explicitly requested by user.
- Add new option to "link to" option in images to point at optimized version of original image, and a warning/similar to the option to link to actual original image to avoid site admins loading original images into things like lightboxes.