Webfonts optimieren

Wer sein Webdesign mit einer schönen Schriftart von anderen abheben möchte, der setzt auf Webfonts. Diese lassen sich anschließend auf verschiedene Arten in das Design einbinden. Damit es zu keinen großen Performance-Einbußen kommt, gibt es eine Möglichkeit auch die Webfonts mittels eines .htaccess-Eintragen, und einem installierten Apache-Modul, zu beschleunigen.
Mit den nachfolgenden Zeilen wird GZIP auch für Webfonts, für .otf, .eot and .ttf Dateien, aktiviert.

Öffnet die .htaccess-Datei und fügt folgende Zeilen hinzu:

#Gzip für Webfonts
<ifmodule mod_deflate.c>
<ifmodule mod_mime.c> #Checks if your server supports Addtype
Addtype font/opentype .otf
Addtype font/eot .eot
Addtype font/truetype .ttf
</ifmodule>
AddOutputFilterByType DEFLATE font/opentype font/truetype font/eot
</ifmodule>
#End Gzip für Webfonts

Alternativ könnt Ihr folgende Codezeilen für die .htaccess verwenden:

#Gzip für Webfonts
<ifmodule mod_deflate.c>
<ifmodule mod_mime.c> #Checks if your server supports Addtype
Addtype font/opentype .otf
Addtype font/eot .eot
Addtype font/truetype .ttf
</ifmodule>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
application/x-javascript application/javascript text/text
font/opentype font/truetype font/eot
</ifmodule>
#End Gzip für Webfonts