Link to home
Start Free TrialLog in
Avatar of Sivakatirswami
Sivakatirswami

asked on

How Do We Tell Apache to Gzip Font Files?

I want to enter the correct parameters to the httpd.conf file  to get Apache to gzip webfonts.

I already have this in the root httpd.conf for all domains on the box.  But webfonts have no established mime-type (that I know of... as of Feb 2011)  so how do you tell Apache to gzip all
*.eot *.otf *ttf *.woff *.svg web font files before filling the GET request?

AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript application/x-httpd-php


Avatar of xterm
xterm

You could do it by file extension instead of mime type:

mod_gzip_item_include file \.eot$
mod_gzip_item_include file \.otf$
mod_gzip_item_include file \.ttf$
mod_gzip_item_include file \.woff$
mod_gzip_item_include file \.svg$

BTW, there are mime types for a couple of these already, but seems like more work to do it that way (application/vnd.ms-fontobject = eot, application/vnd.oasis.opendocument.formula-template = otf, etc.)
Avatar of Sivakatirswami

ASKER

OK... do you just add these lines like you have them above to httpd.conf, one line per file type?
ASKER CERTIFIED SOLUTION
Avatar of xterm
xterm

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Outstanding, Sorry for delay in responding... very busy here, but this is great thanks!
No problem, enjoy :)