Support » Plugin: Autoptimize » Redundant load of Google Fonts Css

  • Resolved retetecugust

    (@retetecugust)


    Hi,

    I have the checkbox to remove google fonts enabled. But my site loads from the autoptimize cache some CSS for a font that I do not use anyway, the base font Open Sans. It tries to load it 2 times, first error 301 and then 404, and it takes some time to do this, a few good seconds.

    This is the link in question :

    https://retetecugust.com/wp-content/cache/autoptimize/css/%22https:/fonts.googleapis.com/css?family=Open+Sans%22

    Can you please verify and remove these requests ?
    First I had it unchecked for a while, then checked it recently and then purged cache several times.

    If you load my site in pingdom, you can see these requests.

    Thank you for a good working plugin.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    that’s due to a known bug in the most recent version of jetpack @retetecugust, more info in this thread.

    hope this clarifies,
    frank

    retetecugust

    (@retetecugust)

    Hi Frank,

    I read the thread, thank you for it. But can’t you fix this from your end, since the request is from this plugin’s cache ? I do not see other similar requests apart from these 2 that load this link from the cache of autoptimize. Especially since the checkbox is enabled, can’t you bypass this link somehow … don’t cache-it, don’t use it, filter-it out .. etc. ?

    It says the referer of this url is the css this plugin does ->
    https://retetecugust.com/wp-content/cache/autoptimize/css/autoptimize_8b996cc101c117d829076e590c5853c0.css

    I verified and it is there:

    @font-face {
    font-family: Noticons;
    src: url(‘”https://wordpress.com/i/noticons/Noticons.woff”‘)
    }
    @font-face {
    font-family: “Open Sans”;
    src: url(‘”https://fonts.googleapis.com/css?family=Open+Sans”‘)
    }

    This is from the concatenated css autoptimize does, maybe there is a matching string issue ?

    Best Regards

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    It says the referer of this url is the css this pplugin does

    I know, but that’s simply because AO aggregates all CSS (and JS), so it _seems_ to be coming from AO but it is originally coming from Jetpack. changing AO (and pushing out an update) to work around a bug in another plugin that undoubtable will get fixed anyway is somewhat .. over the top.

    the best approach -while waiting for the jetpack update- would be to change the jetpack css-file instead as described in the jetpack support thread 🙂

    retetecugust

    (@retetecugust)

    I understand your point of view, it will probably get fixed. Unfortunatelly I cannot modify that css, so I will try to figure out how to modify your plugin, which I can edit, and match also those cases.

    Have a nice day !

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Well, if you’re into coding you could hook into AO’s autoptimize_css_after_minify filter to replace

    @font-face{font-family:”Open Sans”;src:url(‘”https://fonts.googleapis.com/css?family=Open+Sans”‘)}

    with

    @font-face{font-family:”Open Sans”;src:url(”https://fonts.googleapis.com/css?family=Open+Sans”)}

    🙂

    retetecugust

    (@retetecugust)

    I hooked into what you said above,except I replace the url thing with “”, it works.

    Good evening 🙂

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    great job @retetecugest 🙂

    have a nice weekend!
    frank

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Redundant load of Google Fonts Css’ is closed to new replies.