Make WordPress Core

Changes between Version 2 and Version 3 of Ticket #57459, comment 3


Ignore:
Timestamp:
01/21/2023 12:09:08 AM (2 years ago)
Author:
azaozz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #57459, comment 3

    v2 v3  
    1919> Is this feedback you've received from plugin authors?
    2020
    21 No. I tried to make a plugin that uses it and didn't like the results. Ended up with a function that gets the file size (with `wp_filesize()`) when the meta is missing. Then tested the "savings" per image (all sub-sizes). Getting sizes with wp_filesize() when the image meta was already available was slower by 0.07ms. If the meta was not loaded, retrieving it was considerably slower. The chance that image file size could be missing made it pretty much impractical to retrieve the image meta.
     21No. I tried to make a plugin that uses it and didn't like the results. Ended up with a function that gets the file size (with `wp_filesize()`) when the meta value is missing. Then tested the "savings" per image (all sub-sizes). Getting sizes with wp_filesize() when the image meta was already available was slower by 0.07ms. If the meta was not loaded, retrieving it was considerably slower. The chance that image file size could be missing made it pretty much impractical to retrieve the image meta.
    2222
    2323Add to that the chance that the cached value in the meta may be wrong/outdated, and it seems not a good idea to use it.