At the moment, WordPress does not store the file (storage) sizes for uploaded files, or the sizes of media generated, in the database. At the moment, whenever WordPress needs to find out this information, it needs to read from the filesystem, or make remote requests in the case of a CDN. This keeps WordPress from using this information to make more informed decisions about responsive images or resizing in a performant fashion.
We should store file sizes as attachments are uploaded, and use this information in appropriate existing locations in core where file size is queried.
Trac ticket: https://core.trac.wordpress.org/ticket/49412
At the moment, WordPress does not store the file (storage) sizes for uploaded files, or the sizes of media generated, in the database. At the moment, whenever WordPress needs to find out this information, it needs to read from the filesystem, or make remote requests in the case of a CDN. This keeps WordPress from using this information to make more informed decisions about responsive images or resizing in a performant fashion.
We should store file sizes as attachments are uploaded, and use this information in appropriate existing locations in core where file size is queried.
Trac ticket: https://core.trac.wordpress.org/ticket/49412