Open adamsilverstein opened 3 months ago
I see this is labelled for the Modern Image Formats plugin, however all of the Site Health tests have been located in the Performance Lab plugin. I think it makes sense to move Site Health tests which are closely related to certain plugins to actually move them to those plugins.
I think it makes sense to move Site Health tests which are closely related to certain plugins to actually move them to those plugins.
+1 - Good point, I think we discussed that already.
Feature Description
When the server supports AVIF processing, add detection in site health to check if AVIF images are being served with the avif type or with octet-stream. Warn users when avif isn't being used. Consider attempting to apply fix via .htaccess?
Details
Since launching AVIF support in WordPress 6.5, some users are discovering that their AVIF images are being served with the network type "octet-stream". The impact is relatively low since browsers know to serve these
.avif
files as AVIF images, however it is worth trying to detect and fix if possible.Examples
The website https://ground-cd.com/blog/avif/ uses AVIF images, checking the network panel the type shows as "octet-stream" instead of "avif".
On the other hand, this site serves up AVIF images correctly, with the avif type: https://aomedia.org/blog%20posts/avif-meet-the-next-level-image-file-format/
Underlying issue
This issue can happen if the web server does not include the
image/avif
MIME types in its configuration. For Apache, the host may have a custom config, and configurations could (possibly) be added via.htaccess
Nginx added AVIF to their base config in 2021 (PR).
Apache config would probably be host or distribution dependent, so these might need updating. For Apache, I opened this PR to add it to their config. Users can ask their hosts to add the configuration and this is a very low risk change for hosts.
Suggested fix