[wp-trac] [WordPress Trac] #49412: Store filesize media metadata
WordPress Trac
noreply at wordpress.org
Wed May 12 18:54:25 UTC 2021
#49412: Store filesize media metadata
-------------------------------------------------+-------------------------
Reporter: Cybr | Owner:
| johnwatkins0
Type: feature request | Status: assigned
Priority: normal | Milestone: Future
| Release
Component: Media | Version:
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests needs- | Focuses:
refresh | performance
-------------------------------------------------+-------------------------
Comment (by spacedmonkey):
It is worth noting my personal interest in this ticket.
I noticed that in my logs, I was getting lots of calls S3 api. It turns
out when looking at assets in the media library, the filesize lookup,
resulted in an API request for every file. As filesize is displayed in
media library in multiple places, these request rack up. It is also worth
noting, if assets on being offloaded in other ways like jetpack, it is
likely that this will also be an issue. Even assets stored "Local" on a
network share, but have a slow response to get filesize call.
Add a filter to get filesize would be extremely useful for anyone loading
assets. I think that `wp_fileszie()` maybe useful in other parts of core,
even if it was just used to help mocking in unit tests.
As for if the data is incorrect, that is up to developer to fix, but if
they not fix filesize after processing, it likely that other metadata is
wrong as well.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49412#comment:27>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list