[wp-trac] [WordPress Trac] #55443: Create WebP sub-sizes and use for output
WordPress Trac
noreply at wordpress.org
Thu Sep 1 19:39:00 UTC 2022
#55443: Create WebP sub-sizes and use for output
-------------------------------------------------+-------------------------
Reporter: adamsilverstein | Owner:
| adamsilverstein
Type: enhancement | Status: assigned
Priority: normal | Milestone: 6.1
Component: Media | Version: 6.0
Severity: normal | Resolution:
Keywords: has-unit-tests needs-dev-note | Focuses:
needs-docs needs-user-docs 2nd-opinion needs- | performance
testing changes-requested |
-------------------------------------------------+-------------------------
Comment (by adamsilverstein):
> Q1) What happens on a site with 100GB of existing images when thumbnails
are regenerated (wp media regenerate, by a plugin, or by woo-commerce)?
If this doesn't "blow up large sites" I'll begrudgingly drop my constant
pleas for an option.
I took a look at this a bit more carefully:
- `wp media regenerate` **deletes old thumbnails by default** unless you
pass `--skip-delete`. You can also pass `--only-missing` to regenerate
only for new or changed sizes, sizes with existing meta wouldn't be
regenerated
- `regenerate-thumbnails` plugin (no longer supported) by default "Skips
regenerating existing correctly sized thumbnails" - meaning WebPs would
only be generated for newly added sizes.
- `regenerate-thumbnails-advanced` similarly only generates
missing/changed sizes by default ("Don't redo existing").
- `woocommerce` - as far as i can tell looking at the code only
regenerates sizes that have changed dimensions, or new sizes.
> Q2) Is anything being done to where WebP would actually benefit existing
content (ie. old posts/pages written with the classic editor)?
yes. by default, WordPress filters the content, so images inserted from
the media library (not by URL) will get updated on the fly to newer
subsizes, if you `wp media regenerate` older content should start using
the new WebPs (and your old JPEGs will be deleted).
>
> Q3) How are the < 2% of browsers that don't support WebP going to be
addressed (again, that's predominantly old iOS devices)
using a tiny bit of feature dection JS on pages with WebPs we can swap out
images for the smallest JPEG we have (possibly the original upload). The
approach would be similar to https://github.com/WordPress/wordpress-
develop/pull/3034
--
Ticket URL: <https://core.trac.wordpress.org/ticket/55443#comment:176>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list