Fonts Never Compress

#1
I do a lot of optimization work and have noticed that no matter how many tutorials I go over the fonts request are not being compressed. There is no Content-Encoding header being set and I'm verifying the issue through both Chrome and Firefox via the network panels of the built in developer tools and the Apache access logs. I am not a web host myself, my host is the one using LiteSpeed.

Here are just some of the things I tried to do to compress the ttf files:

Example #1
Code:
AddOutputFilterByType DEFLATE application/x-font-ttf application/vnd.ms-fontobject
Example #2
Code:
AddEncoding x-compress .ttf
Example #3
Code:
AddEncoding x-gzip .ttf
Example #4
Code:
AddOutputFilterByType DEFLATE *
Example #5
Code:
AddType application/x-font-ttf ttf ttc
AddType application/x-font-woff woff
AddType font/opentype otf

AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
It's not difficult to verify if a file is compressed before it's been transferred as Waterfox's Developer Tools Network Panel will show total and transferred; if they are the same for an HTTP request then there was no compression.
 

Tishu

Well-Known Member
#2
Hello,

From litespeed webadmin -> Configuration -> Server -> Tuning -> GZIP Compression add:

Code:
application/x-font-ttf, application/font-sfnt
( and others).
 
Last edited by a moderator:
Top