当前位置:首页 > 电脑·技巧 > 正文

简单解决因为Google被墙而导致WP访问速度慢

最近,有网友反映称谷歌官网域名google.com、谷歌香港google.com.hk都打不开, ping了一下google.com和google.com.hk两个域名的服务器情况,最后ping出来的IP地址均显示为“美国”,也就是说谷歌香港(google.com.hk)的服务器,已由香港转移至美国,所以链接时间会很长,甚至断断续续出现请求超时的情况

20140605100351731

图:google.com.hk域名服务器ping测结果

 Google服务在大陆的崩溃情况不仅影响到了广大网民,也影响到了数百万的站长。WordPress是世界上最大的开源博客程序,而WordPress大部分的主题都在使用Google的在线字体方案——Google Fonts,Google服务一不稳定,大量的独立博客字体就加载不出来,直接导致了几十万独立博客打开速度令人无法忍受,严重的时候会导致网站打不开。

图:Google字体打开时间19秒

图:Google字体打开时间19秒

   为此,360网站卫士推出一项字体加速服务,站长只要修改一行代码,就可以免费使用到由360网站卫士CDN加速的字体服务。

 修改方法如下:

打开wordpress代码中的文件wp-includes/script-loader.php文件,搜索:fonts.googleapis.com找到这行代码:

$open_sans_font_url = “//fonts.googleapis.com/css?family1=Open+Sans:300italic,400italic,600italic,300,400,600⊂=$subsets”;

把fonts.googleapis.com替换为fonts.useso.com

把fonts.googleapis.com替换为fonts.useso.com

   修改完保存,再次刷新,大家就可以发现,自己的网站速度已经比以前快了很多,几乎瞬间就可以拿到Google字体了。原因就是本来需要从美国服务器才能拿到的google字体,现在已经遍布360全国的机房了。

20140605100351261

标签:
上一篇: 下一篇:

470 条评论

评论加载中...
  1. Hello great website! Does running a blog similar to this require a massive amount work?
    I’ve absolutely no expertise in computer programming however I had been hoping
    to start my own blog in the near future. Anyways, if you have any suggestions or tips for new blog owners please share.
    I understand this is off topic but I just wanted to ask.
    Appreciate it!

    10小时 之前 评论
  2. 466楼
    这家伙可能用了美佬的代理 谷歌浏览器 Mac OS X 10_11_6
    department  

    You have made some really good points there.

    I looked on the net to learn more about the issue and found most individuals will go along with
    your views on this site.

    10小时 之前 评论
  3. 465楼
    这家伙可能用了美佬的代理 火狐浏览器 Windows 10
    tall litter box  

    I really like your blog.. very nice colors & theme. Did you make this website yourself or did you
    hire someone to do it for you? Plz respond as I’m looking to create my
    own blog and would like to know where u got this from.
    kudos

    12小时 之前 评论
  4. Fantastic beat ! I wish to apprentice at the same time as you amend your website, how could
    i subscribe for a blog site? The account helped me a applicable deal.

    I were tiny bit familiar of this your broadcast provided vivid transparent
    concept

    13小时 之前 评论
  5. I don’t know if it’s just me or if perhaps everybody else experiencing issues with your
    blog. It appears like some of the written text on your content are running off the
    screen. Can somebody else please comment and
    let me know if this is happening to them as well? This
    could be a problem with my web browser because I’ve had this happen previously.
    Many thanks

    17小时 之前 评论
  6. Hi! I just would like to give you a huge thumbs up for the excellent information you have here
    on this post. I am coming back to your blog for more
    soon.

    18小时 之前 评论
  7. Keep this going please, great job!

    19小时 之前 评论

发表评论

不理你。不要啊!吃饭。吃惊。吃西瓜。飞吻!恭喜!Hi纠结!膜拜!OK抛媚眼。泡泡糖。抛钱。忍!生闷气!调皮。偷看。委屈。献花。疑问?抓狂!

小提示:Ctrl+Enter快速提交助您一臂之力~
加载中……