What is MIME type "application/font-woff"?
A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.
application/font-woff is a MIME type for web font files. It tells browsers how to handle fonts delivered over the internet.The format is used to embed custom fonts in web pages. This helps websites keep a consistent and attractive look while loading fonts efficiently.
- Main use case: delivering custom fonts for styling websites and ensuring design consistency.
- Optimization: the format compresses font data for faster loading and lower bandwidth use.
- Compatibility: supported by modern browsers to render text accurately on various devices.
For more details on the specifications, visit the W3C WOFF Specification.
Associated file extensions
Usage Examples
HTTP Header
When serving content with this MIME type, set the Content-Type header:
Content-Type: application/font-woff
HTML
In HTML, you can specify the MIME type in various elements:
<a href="file.dat" type="application/font-woff">Download file</a>
Server-side (Node.js)
Setting the Content-Type header in Node.js:
const http = require('http');
http.createServer((req, res) => {
res.setHeader('Content-Type', 'application/font-woff');
res.end('Content here');
}).listen(3000);
Associated file extensions
FAQs
Is application/font-woff the official MIME type for WOFF files?
While application/font-woff was widely used historically, the IANA has officially standardized the MIME type as font/woff. However, browsers maintain backward compatibility, so application/font-woff still works correctly on most websites.
How do I configure Apache to serve WOFF files?
To serve these files correctly on Apache, add the directive to your .htaccess file or httpd.conf. Use the line: AddType application/font-woff .woff to ensure browsers interpret the file as a font.
Why do I get a Cross-Origin Request Blocked error for my fonts?
Web fonts are subject to CORS (Cross-Origin Resource Sharing) security policies. If you host your WOFF files on a CDN or a different subdomain, you must configure the server to send the Access-Control-Allow-Origin header.
What is the difference between WOFF and WOFF2?
The main difference is compression. WOFF2 uses the Brotli compression algorithm, which offers roughly 30% better compression than the Zlib compression used in standard WOFF files. This results in faster page loading times.
How do I enable WOFF support in Microsoft IIS?
IIS does not always have this MIME type configured by default, which can cause 404 errors. You can fix this by adding a <mimeMap> entry in your web.config file: <mimeMap fileExtension=".woff" mimeType="application/font-woff" />.
Should I use application/x-font-woff or application/font-woff?
You should generally avoid the x- prefix (e.g., application/x-font-woff) as it denotes a non-standard experimental type. application/font-woff is preferred over the experimental version, though the modern standard font/woff is the best choice for new projects.
Why does Chrome warn: 'Resource interpreted as Font but transferred with MIME type'?
This warning appears when the server sends a generic MIME type (like text/plain or application/octet-stream) instead of the specific font type. Verify your server configuration matches the specific file extension.
Can I use application/font-woff for WOFF2 files?
Technically, WOFF2 files should be served with font/woff2 or application/font-woff2. While browsers may still render the font if the MIME type is application/font-woff, using the specific subtype for WOFF2 is recommended for correctness.
General FAQ
What is a MIME type?
A MIME (Multipurpose Internet Mail Extensions) type is a standard that indicates the nature and format of a document, file, or assortment of bytes. MIME types are defined and standardized in IETF's RFC 6838.
MIME types are important because they help browsers and servers understand how to process a file. When a browser receives a file from a server, it uses the MIME type to determine how to display or handle the content, whether it's an image to display, a PDF to open in a viewer, or a video to play.
MIME types consist of a type and a subtype, separated by a slash (e.g., text/html, image/jpeg, application/pdf). Some MIME types also include optional parameters.
How do I find the MIME type for a file?
You can check the file extension or use a file identification tool such as file --mime-type on the command line. Many programming languages also provide libraries to detect MIME types.
Why are multiple MIME types listed for one extension?
Different applications and historical conventions may use alternative MIME identifiers for the same kind of file. Showing them all helps ensure compatibility across systems.