Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author asadkn

    (@asadkn)

    A few thing I will need to troubleshoot:

    – Are there any cache plugins installed?
    – If you’re a developer, do you know how the theme/plugin is adding these fonts?

    Perhaps I can figure out what’s going on if you can give a link to the site.

    Thread Starter jezzaz

    (@jezzaz)

    I am trying this out on quite a few sites
    i am using wp rocket and autoptimize, the theme on some of the sites is enfold
    i am seeing this code in view source which i think is from your plugin: <!– google webfont font replacement –>

    <script type=’text/javascript’>
    if(!document.cookie.match(/aviaPrivacyGoogleWebfontsDisabled/)){
    (function() {
    var f = document.createElement(‘link’);

    f.type = ‘text/css’;
    f.rel = ‘stylesheet’;
    f.href = ‘//fonts.googleapis.com/css?family=Lato:300,400,700’;
    f.id = ‘avia-google-webfont’;

    document.getElementsByTagName(‘head’)[0].appendChild(f);
    })();
    }
    </script>
    in gtmetrix it shows:Add Expires headers https://fonts.googleapis.com/css?family=Lato:300,400,700

    does this mean it is still referencing that URL ?

    Thread Starter jezzaz

    (@jezzaz)

    i am also seeing it in gtmetrix in Minify CSS : Minifying https://fonts.googleapis.com/css?family=Lato:300,400,700 could save 29B (7% reduction) after compression

    Plugin Author asadkn

    (@asadkn)

    The JS code is from Enfold theme and it seems like Enfold theme is using a custom-made Javascript loader.

    I think they added it in one of the recent updates but you can ask them if there’s a way to do non-Javascript font loader – the normal / real way of enqueuing stylesheets and assets. I am sure they must have a setting to disable / revert it to original way of loading.

    Unfortunately, as I noted in plugin readme too, auto-replacing fonts for a javascript loader isn’t possible unless the theme provides a way to use normal CSS method (in a CSS file, inline CSS, or using standard WordPress enqueues).

    Thread Starter jezzaz

    (@jezzaz)

    thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Add Expires headers’ is closed to new replies.