缓存验证了谷歌网络字体 [英] Cache validator for Google Webfonts

查看:137
本文介绍了缓存验证了谷歌网络字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我创建一个超优化的网站,并与<一个网页的加载速度href=\"https://developers.google.com/speed/pagespeed/\">https://developers.google.com/speed/pagespeed/是的 99(满分100分)

So I'm creating an ultra optimized site, and my page load speed with https://developers.google.com/speed/pagespeed/ is 99 (out of 100).

让我远离满百的唯一事情是这样的:

The only thing keeping me away from full hundred is this:

通过指定缓存验证工具 - 一个Last-Modified或ETag头 - 你确保缓存资源的有效性,可以有效地确定

By specifying a cache validator - a Last-Modified or ETag header - you ensure that the validity of cached resources can efficiently be determined.

什么?我不知道该怎么办。如何设置缓存验证了谷歌网络字体?

What?! I don't know what should I do. How do I set a cache validator for google webfonts?

我已经在webfont这样的:&LT;链接HREF =HTTP://fonts.googleapis.com/css家庭=打开+三世:400,800'相对=样式类型= 文/ CSS'&GT;

I've the webfont like this: <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,800' rel='stylesheet' type='text/css'>.

我在用的Apache2的Ubuntu如果该事项。

I'm on ubuntu with apache2 if that matters.

下载webfont到服务器并使用它从那里降到比分到96,这样将没有帮助。

Downloading the webfont to server and using it from there drops the score to 96 so that won't help either.

推荐答案

您不能做任何事情。你无法控制的http头谷歌服务器发送。

You can't do anything about it. You can't control what headers google server sends.

我甚至会走这么远说,这是报告误报,你应该可以解决。

I would even go so far as to say it is reporting a false positive that you should fix.

<一个href=\"http://redbot.org/?uri=http%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DOpen%2BSans%3A400%2C800\">http://redbot.org/?uri=http%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DOpen%2BSans%3A400%2C800

正如你所看到的资源被缓存,拥有最大年龄头和甚至融为一体pressed。

As you can see the resource is cached, has a max age header and is even compressed.

您的网站是速度不够快!我就不会担心买100你也许可以停止对其进行优化。

You site is fast enough! I wouldn't worry about getting 100. You can probably stop optimizing it.

但如果你想鼓捣些,这里是改善事物的一些想法,我跑了一份报告:<一href=\"http://www.webpagetest.org/result/130703_H7_15KM/\">http://www.webpagetest.org/result/130703_H7_15KM/

But if you want to tinker some more, here's a few ideas on improving things, I ran a report: http://www.webpagetest.org/result/130703_H7_15KM/

  • I would have your server send a 204 No Content header for your non-existent favicon.ico file OR make one and add it so there's no 404 on the resource.
  • Use a CDN for your resources
  • Use progressive jpegs and optimize the one's you're using

这篇关于缓存验证了谷歌网络字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆