【问题标题】:Google font loaded by webfontloader is render blocking由 webfontloader 加载的谷歌字体被渲染阻塞
【发布时间】:2018-08-28 21:47:11
【问题描述】:

先对不起我的英语。我错过了什么?我使用以下代码来防止渲染阻塞内容:

WebFontConfig = {
    google: {
        families: ['Lato:300,300i,700']
    },
    active: function () {
        //document.querySelector('body').fadeIn(1000);
    },
};

(function () {
    var wf = document.createElement('script');
    wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
        '://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js';
    wf.type = 'text/javascript';
    wf.async = 'true';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(wf, s);
})();

没有成功 speedtest 抱怨渲染阻塞字体 (async = true)...。我想知道是否有另一种方法可以防止这种渲染阻塞......

【问题讨论】:

    标签: asynchronous seo pagespeed webfont-loader render-blocking


    【解决方案1】:

    您可以在 googlewebmaster 中使用 robots.txt。 经验: 禁止:http://exampel.com/postnumber

    【讨论】:

      猜你喜欢
      • 2021-07-26
      • 2013-06-28
      • 2011-11-18
      • 2015-10-25
      • 1970-01-01
      • 2017-05-02
      • 2017-02-01
      • 1970-01-01
      • 2016-04-22
      相关资源
      最近更新 更多