【问题标题】:Does a modern browser also cache files referenced in files that are in the manefest现代浏览器是否还会缓存清单中文件中引用的文件
【发布时间】:2014-06-24 03:56:34
【问题描述】:

我想知道浏览器是否会保存缓存清单中提到的 CSS 文件中提到的“Google 字体”?如果不是,这样做的原因是什么?

【问题讨论】:

    标签: ios html web-applications html5-appcache


    【解决方案1】:

    不,他们没有。这样做的简单原因是他们不知道文件是静态的还是动态的,或者实际上是关于它的任何东西,因此如果他们知道,肯定会造成麻烦。如果您希望在离线应用中使用 Google 字体,您必须通过在几个不同的浏览器中打开相关文件并将 CSS 合并到一个声明中来手动下载文件。

    例如在 chrome 中你会得到这条线

    src: local('Roboto Regular'), local('Roboto-Regular'), url(http://themes.googleusercontent.com/static/fonts/roboto/v11/2UX7WLTfW3W8TclTUvlFyQ.woff) format('woff');
    

    (来源:http://fonts.googleapis.com/css?family=Roboto

    而对于 IE

    src: url(http://themes.googleusercontent.com/static/fonts/roboto/v11/5YB-ifwqHP20Yn46l_BDhA.eot);
    src: local('Roboto Regular'), local('Roboto-Regular'), url(http://themes.googleusercontent.com/static/fonts/roboto/v11/5YB-ifwqHP20Yn46l_BDhA.eot) format('embedded-opentype'), url(http://themes.googleusercontent.com/static/fonts/roboto/v11/2UX7WLTfW3W8TclTUvlFyQ.woff) format('woff');
    

    已送达。所以下载所有不同的版本,然后像这个答案一样组合它:https://stackoverflow.com/a/9569320/1266242

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-09-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-13
      • 2010-10-02
      相关资源
      最近更新 更多