• Resolved Imagewperic

    (@wperic)


    I just downloaded the content of the media library on my live site to my desktop.

    According to the live site, there are 479 items in the media library. Yet filezilla downloaded 2058 files amounting to 1+ gigabites. Why this huge difference?

    The live site is hosted at omnis. My laptop runs Fedora 42 with Filezilla 3.69.1.

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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 Imagewperic

    (@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)?

    Imagehupe13

    (@hupe13)

    Take a look at Disable Media Sizes.

    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

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Why so many media files?’ is closed to new replies.