Tagged: compression, custom font, font, gzip
-
AuthorPosts
-
September 2, 2019 at 6:11 pm #1133085
Hi Guys,
We uploaded custom TTF fonts using the custom font uploader.
These work great but WebPageTest.org complains they are not compressed:“Use gzip compression for transferring compressable responses:
FAILED – (146.4 KB, compressed = 54.0 KB – savings of 92.4 KB) – https://www.domain.com/wp-content/uploads/avia_fonts/type_fonts/galaxie-light/galaxie-light.ttf
FAILED – (132.8 KB, compressed = 46.8 KB – savings of 86.0 KB) – https://www.domain.com/wp-content/uploads/avia_fonts/type_fonts/itcavantgardepro-bk/itcavantgardepro-bk.ttf
FAILED – (51.9 KB, compressed = 23.8 KB – savings of 28.1 KB) – https://www.domain.com/wp-content/uploads/avia_fonts/type_fonts/itcavantgardepro-light/itcavantgardepro-light.ttf”What is the best practice to gzip these fonts?
Thanks!September 2, 2019 at 6:28 pm #1133089it would be better to see your live-page
i have my entries for that in the invisible .htaccess file (in the root directory of the installation)
for older server is gzip and newer ones mod_deflate:# Gzip <IfModule mod_mime.c> AddType application/javascript js AddType application/vnd.ms-fontobject eot AddType application/x-font-ttf ttf ttc AddType font/opentype otf AddType application/x-font-woff woff AddType application/x-woff woff AddType image/svg+xml svg svgz AddEncoding gzip svgz </Ifmodule> # Deflate by FileType <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE text/javascript AddOutputFilterByType DEFLATE image/svg+xml AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/atom_xml AddOutputFilterByType DEFLATE application/x-woff AddOutputFilterByType DEFLATE application/x-font-ttf AddOutputFilterByType DEFLATE application/x-font-woff AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/x-javascript AddOutputFilterByType DEFLATE application/x-shockwave-flash </IfModule>
September 2, 2019 at 8:53 pm #1133119Thanks Guenni007. That is apparently what needs to be done on Apache.
For nginx (mine) here are the instructions:
However my host says this is already enabled on my server. They also say their other testing shows gzip working for the fonts.
So I’m really confused why WebPageTest says it’s not working.
September 2, 2019 at 11:55 pm #1133138yes, you’re right, of course; since you didn’t mention it above, I once assumed the most common case. But I hope the htaccess hint has led you in the right direction with your nginx.conf.
With an IIS server it would be the web.config file
-
AuthorPosts
- You must be logged in to reply to this topic.