Also, the favicon png and webmanifest
Oddly, seems to affect more fonts on Firefox?
GTMetrix Firefox
GTMetrix Chrome
-
This reply was modified 6 years, 2 months ago by
slapbox.
Hello @slapbox
Thank you for your inquiry and I am happy to assist you with this.
Can you please share your .htaccess file so I can check the rules?
Thank you!
Hey Marko, thanks for your reply.
We’re not using Apache at all, only Nginx. Here’s a pastebin of the nginx.conf output for W3TC. woff and woff2 don’t seem to be mentioned. https://pastebin.com/Btx7dmLS
No other directives we have affect woff/woff2 files either.
-
This reply was modified 6 years, 2 months ago by
slapbox.
Hello @slapbox
Indeed woff|woff2 are not being handled by your nginx rules. I’ve checked our installations and woff|wpff2 are there.
Make a backup of your Nginx.conf and add the following at the beginning of your nginx.conf:
location ~ \.(woff|woff2)$ {
expires 31536000s;
etag on;
if_modified_since exact;
add_header Pragma "public";
add_header Cache-Control "public";
add_header Strict-Transport-Security "max-age=31536000";
add_header Referrer-Policy "";
try_files $uri $uri/ /index.php?$args;
}
Save all settings and purge the cache. Make sure to purge the cloudflare cache as those files are being served from cloudflare atm.
Let us know if this helps!
Thank you!
Hey Marko, I actually made that change on my own in the nginx.conf – but the rules I shared are the output of W3TC’s rules. I tried a bunch of things to get it working within WordPress/W3TC before making the issue. If anyone else has this issue, it might point to some issue with W3TC updating the nginx.conf.
Thanks for your help!
Hello @slapbox
Thanks for the information!
Same issue with woff/woff2 files and nginx config here. Suggested rules get deleted after any W3TC config change.
Hello @brutforce21
Thank you for the information.
You need to add those lines outside of the W3TC block.
Thank you!
Hi @vmarko,
Thank you for the prompt reply! Totally make sense.
Will this be added to the stable W3TC release? As Apache config has these rules.
Hello @brutforce21
It’s already added. but in some cases, it’s not taking effect due to the environment.
In some cases, the ETag header is unset if browser compatibility is enabled. In-Page Cache -> Advanced there’s an option Compatibility mode,
Thanks!
@vmarko, if that helps – Compatibility mode is DISABLED.
etag section of config just miss woff/woff2.