Fonts Never Compress

Discussion in 'Bug Reports' started by JAB Creations, Mar 22, 2018.

  1. JAB Creations

    JAB Creations Member

    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.
     
  2. Tishu

    Tishu Well-Known Member

    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: Mar 26, 2018

Share This Page