Reputation: 29511
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-woff2
font/woff2
would work.
Apparently, neither does.
Further Info:
.htaccess
files overriding the global .htaccess
file.htaccess
directives 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...) ?
Upvotes: 0
Views: 666
Reputation: 67
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
gzip on;
gzip_vary on;
zip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_min_length 256;
gzip_types
font/eot
font/otf
font/ttf
image/svg+xml
text/css
text/javascript
text/plain
text/xml;
Upvotes: 1