Compress/Deflate @font-face fonts Compress/Deflate @font-face fonts apache apache

Compress/Deflate @font-face fonts


Came up with a solution:

Use Apache's AddType declaration to add a custom mime type and then use that mime type in the AddOutputFilterByType declaration.

For example, for opentype and truetype fonts:

Addtype font/opentype .otfAddtype font/truetype .ttfAddOutputFilterByType DEFLATE text/html text/plain text/xml text/css font/opentype font/truetype

Both these declarations require their appropriate modules to be active: mod_mime and mod_deflate. And for best practice, the AddType declaration should be in the mime.conf file, and the AddOutputFilterByType declaration should be in the deflate.conf file. See your particular distribution's help files for enabling and configuring Apache modules.