Gzipping .ttf files

I cannot gzipped these .ttf files because of the extension appended to them: ?vjfhgj and ?tppylb



I get a warning in webpagetest.org for potential savings if apply gzip compression to them. All files have being compressed except those two.


    AddType application/vnd.ms-fontobject    .eot
    AddType application/x-font-opentype      .otf
    AddType image/svg+xml                    .svg
    AddType application/x-font-ttf           .ttf
    AddType application/font-woff            .woff
    AddType application/font-woff2           .woff2

I cleared custom cache for individual files and purged everything, nothing fixed it. ¿Any idea how to solve it?

The normal mime type for ttf files is:
AddType font/ttf .ttf

Change that line in your .htaccess and the issue should be resolved, as cloudflare will automatically compress the files.

Do you know where the query parameter is coming from? Are they always the same?


I added it to .htaccess, but issue persists, yes those two query parameters are always the same, I dont know their origin.

<IfModule mod_mime.c>
 AddType font/ttf .ttf

Is this line still in your .htaccess?

Can you share a URL for the font?

This one is:

<IfModule mod_mime.c>
AddType image/webp .webp
AddType font/ttf .ttf

Urls for the fonts:

I see, does CF supports those types?

Yes, obviously.

I placed these types in .htaccess of public-html and wp-content

<IfModule mod_mime.c>
    AddType image/webp .webp
    AddType application/vnd.ms-fontobject .eot
    AddType application/x-font-truetype .ttf
    AddType application/font-woff .woff
    AddType application/x-font-opentype .otf
    AddType application/octet-stream .otf .ttf 

with no success yet, I would apreciate your help

This type of configuration on your Apache server is outside the scope of this forum. Probably best to head over to StackOverflow.

1 Like

This topic was automatically closed after 14 days. New replies are no longer allowed.