Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve performance of get_available_post_mime_types #104

Open
srtfisher opened this issue Aug 23, 2024 · 0 comments
Open

Improve performance of get_available_post_mime_types #104

srtfisher opened this issue Aug 23, 2024 · 0 comments
Labels
enhancement New feature or request php Requires understanding PHP

Comments

@srtfisher
Copy link
Member

Description

I would like to see the performance of get_available_post_mime_types() improved as the underlying database query can be quite expensive on large sites:

SELECT DISTINCT post_mime_type FROM wp_posts WHERE post_type = 'attachment' AND post_mime_type != ''

This is being flagged by New Relic, too.

Use Case

When a user views the media library and the underlying call to get_available_post_mime_types() is made the function should return quickly from the cache.

@srtfisher srtfisher added enhancement New feature or request php Requires understanding PHP labels Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request php Requires understanding PHP
Projects
None yet
Development

No branches or pull requests

1 participant