• Resolved slapbox

    (@slapbox)


    Every other other type of asset does have an expiration specified.

    I had thought there used to be a field for what file types to include/exclude, but I don’t see that anywhere. Is there something I can do to get woff2 files to be processed by W3TC?

    Thanks for your hard work Marko.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter slapbox

    (@slapbox)

    Also, the favicon png and webmanifest

    Oddly, seems to affect more fonts on Firefox?

    GTMetrix Firefox

    GTMetrix Chrome

    • This reply was modified 4 years, 9 months ago by slapbox.
    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    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!

    Thread Starter slapbox

    (@slapbox)

    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 4 years, 9 months ago by slapbox.
    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    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!

    Thread Starter slapbox

    (@slapbox)

    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!

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    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.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    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.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    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.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘woff2 files do not have an expiration specified’ is closed to new replies.