I have the following in my global .htaccess file on my nginx server:
# COMPRESS FILES
<IfModule mod_deflate.c>
[...]
AddOutputFilterByType DEFLATE application/font-woff2
AddOutputFilterByType DEFLATE font/woff2
[...]
</IfModule>
I understand there was some controversy a while back over what MIME Type should represent .woff2 files, but I was hoping that one of these lines:
application/font-woff2font/woff2
would work.
Apparently, neither does.
Further Info:
- I don't have any deeper
.htaccessfiles overriding the global.htaccessfile - My server version is nginx/1.21.6 (on this basis, I've never really understood how
.htaccessdirectives work at all, but I use a good handful of modules and all the directives work)
Question:
Am I using the wrong MIME Type?
Or is the issue likely to be nginx related?
(Or something else which hasn't crossed my mind yet...) ?
Most probably you shall modify nginx.conf file to add the required compression.
.htaccess file will not work in NGINX
To have better coverage on compression and performance over NGINX, you may use pagespeed module
https://developers.google.com/speed/pagespeed/module
Example code block for nginx.conf file