Support » Plugin: Optimize Images Resizing » only when actually needed?

  • “images are resized only when they are actually needed. What that means is that if your plugins/theme define a lot of image sizes, none of them will be generated on the image upload (like they would be usually), but only if they are actually requested in that size.”

    I don’t understand what this means. What determines need? What happens if you’re using a page builder like Elementor? When you select an image to insert, it gives you the image size choices. What about WooCommerce, do all the product images get erased with this plugin? Totally lost…….

Viewing 2 replies - 1 through 2 (of 2 total)
  • Anyone?

    Plugin Author OriginalEXE

    (@originalexe)

    Hello, apologies for missing your question!

    The “need” is determined by code calling the internal WordPress functions that fetch the image in a specific size.

    For example, your WooCommerce theme on the frontend might have this:
    <?php the_post_thumbnail('shop_catalog'); ?>

    When a page that contains that code is requested, plugin will check if the image of that size already exists, and if not, do the resizing and serve the image.

    For the Elementor plugin, I can’t tell you precisely since I have never used it, but it depends how it handles the selection. Does it generate all URL’s before offering your selection (in which case it would generate all sizes at once losing the benefit of this plugin), or maybe it only saves the info about the image you need and then on the frontend it does the actual fetching of the image URL.

    As for the WooCommerce product images, they don’t get deleted, only their additional images. Then, if they are requested by plugins/themes (through the use of the functions as I mentioned above), they get regenerated.

    The benefit of this approach over the default WordPress way is that sizes are generated only when your code actually requests them, and not when the image is uploaded.

    • This reply was modified 2 years, 8 months ago by OriginalEXE.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘only when actually needed?’ is closed to new replies.