Dynamic Image Generation

EWWW I.O. has this neat feature where any image that is created by the WP_Image_Editor class will get automatically optimized. This helps when plugins generate images for sliders, and when themes create header images and such that are not stored in the Media Library.

There are even some plugins and themes that will dynamically generate image resizes to be compatible with certain widgets, or various screen sizes. This is a nice feature for them to provide, but such functions need to take care that they cache such images to disk. Otherwise they will have to regenerate these images over and over again. The mechanism for image generation can vary, some generate them in batches, others do it when a visitor loads a page on your site. In either case, if the images are not cached to disk, the images will be regenerated, resulting in repeated optimization of the same images. This is because EWWW I.O. tracks images by file size, but when an image is regenerated, the file size changes back to the original.

When such a problem occurs, EWWW I.O. will generally throw a warning message, so what to do when you get the warning?

The first thing to do is hit the reset link, to make sure the problem is still occurring. If the warning comes back, then you need to turn on EWWW's debugging setting, and wait for enough information to collect. 12 hours is usually a safe amount of time to wait, but often the issue is such that you only need to wait an hour or two. When debugging is enabled, you will find a couple new items in the Media menu. Visiting the Dynamic Image Debugging page is where the important information will show up. If the page just shows a bunch of sections that say "Cannot display trace", then you need to wait longer. Once there are a few images that have multiple re-optimizations, complete with trace logs, it will show from where the image generation is coming. If the trace logs don't make a lot of sense, just contact us for help tracking down the issue.

Still need help? Contact Us Contact Us