WOFF2 - HTTP Content-Type response header suggestion

I was having the same problem.

I think that pagespeed is misreporting the underlying cause which is not so much a lack of definition of the charset, but a lack of definition of the content-type. Without that's being defined, it / most browsers assume what is being sent back is text/html, where, indeed, no charset has been defined, especially as the .woff2 file will contain "non-standard" (ASCII!) chars.

My solution (it may not work if your apache environment is significantly different, such as not allowing addtype in .htaccess files) was to add the following to the .htaccess in the relevant root of the site being served:

AddType application/x-font-woff2 .woff2

(Found this resource)

Worked for me!

.htaccess

Tags:

.Htaccess

Woff