Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #55443, comment 118


Ignore:
Timestamp:
08/18/2022 07:06:21 PM (2 years ago)
Author:
adamsilverstein
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #55443, comment 118

    initial v1  
    3636> Another thing that seems to not make sense is the idea to replace images by default. Why would this be needed? Only newly uploaded images will have WEBP sub-sizes, right? Then they will be used when composing new content, right? Why would WP spend so much resources looking at places where old images are used?
    3737
    38 The would be used for new content if they were the only type, but since we are keeping both, the original type (JPEG) will be used in the content by default. An additional consideration is image regneration - if users regenerate their past images, the secondary type would be generated (WebP) and the on the fly replacement will upgrade their past content images as well.
     38The would be used for new content if they were the only type, but since we are keeping both, the original type (JPEG) will be used in the content by default. An additional consideration is image regeneration - if users regenerate their past images, the secondary type would be generated (WebP) and the on the fly replacement will upgrade their past content images as well.
    3939
    4040You bring up a good point here though, there is a potential extra load cost to replacing these images that would be worth quantifying. Worth noting that this work takes place in the context of existing per-image content processing in `wp_filter_content_tags` where we already prime caches on the attachment IDs (so the cost should be low).
     
    4444We can investigate how much this slows down sites. As I mentioned, the meta call should return cached data and one of the very check looks for `empty( $metadata['sources'] )` - returning early in that case.
    4545
    46 Also, this would still be required for new sites unless we make "only WebP" the default output.
     46Also, this would still be required for new content unless we make "only WebP" the default output.
    4747
    4848