In a word, thumbnails.
Why serve giant 4032 x 3024 pixel photos (and turn around to squish them down) just to display 150 x 150 post thumbnail? Not only is this wasteful and will cost you more in hosting (bandwidth/visitors limit), but it will also make your site very slow to your users (and expensive for your users on metered internet access) and potentially affect your search engine performance.
For this reason, WordPress, by default, generates 3 smaller dimensions whenever you upload an image: 150 x 150 (thumbnail), 300 x 300 (medium), 1024 x 1024 (large). Your theme then uses the appropriate dimension in different parts of the site.
This means, by default, you have 4 files per image uploaded (assuming the originals are larger than the “large” size): the original + 3 generated thumbnails. Additionally, some themes (and even plugins) can “register” additional image sizes to be generated any time you upload an image.
So 2058 files for a 479 library is not unreasonable. That almost lines up with the 4 files per uploaded image mentioned above.
Of course, this is WordPress land, and users are free to tweak things as they please… even disabling features that are generally considered to be best practices 😀
Thread Starter
wperic
(@wperic)
Thanks, George. I didn’t realize that WP was treating “all 4” as one item.
Does having a media library of that size, when we’re only using maybe a hundred or so of the images on the site, have any cost (e.g, slowing things down)?
Does having a media library of that size, when we’re only using maybe a hundred or so of the images on the site, have any cost (e.g, slowing things down)?
As you are now aware, when you want to move the media library around it does.
For the front-end experience though, it should make things faster or have little effect. As mentioned previously, they are created in order to serve a proper image size for the space it is presented in. So if it is done correctly the images displayed will be the of the optimal size and should result in smaller files getting served
Of course, it might not be done correctly and you still just serve the full image. Having the files and not using them wouldn’t slow the site down though, it’s just a lot of extra files