由webfontloader加载的Google字体呈现阻止

问题描述 投票:0回答:1

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

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个回答
0
投票

您可以在googlewebmaster中使用robot.txt。 exp:disallow:http://exampel.com/postnumber

© www.soinside.com 2019 - 2024. All rights reserved.