What Is This?
The font/woff2 MIME type indicates that the content is a WOFF2 (Web Open Font Format 2) font file. WOFF2 is the most modern and efficient web font format, offering 30-50% better compression than WOFF. It is the recommended format for serving custom fonts on the web.
Common Uses
Common Use
Custom web fonts loaded via @font-face CSS rules
Common Use
Icon font libraries (Font Awesome, Material Icons)
Common Use
Variable font files
Common Use
Typography optimization for web performance
Examples
Serve files with the font/woff2 MIME type:
# Nginx
location ~ \.woff2$ {
add_header Content-Type "font/woff2";
}
# Apache
AddType font/woff2 .woff2Use this MIME type in HTML or HTTP:
Content-Type: font/woff2 <!-- HTML reference --> <link rel="preload" href="file.woff2" as="fetch" crossorigin>
Frequently Asked Questions
Should I use WOFF2 or WOFF?
Always use WOFF2 for browsers that support it and provide WOFF as a fallback. WOFF2 offers significantly better compression, reducing font file sizes and improving page load times.
Do I need CORS headers for web fonts?
Yes. Web fonts served from a different domain require Access-Control-Allow-Origin: * (or your domain) CORS headers. Without CORS, browsers block font loading for cross-origin @font-face declarations.