【问题标题】:Leveraging maps.googleapis browser caching, as per Google PageSpeed Insights advice根据 Google PageSpeed Insights 的建议,利用 maps.googleapis 浏览器缓存
【发布时间】:2016-11-12 07:54:31
【问题描述】:

以下脚本:

<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=<my-key>&libraries=places"></script>

从 Google PageSpeed Insights 扫描页面时会出现警告:

考虑修复:

利用浏览器缓存在 HTTP 标头中为静态资源设置过期日期或最长期限 浏览器从本地磁盘加载以前下载的资源 而不是通过网络。利用浏览器缓存 以下可缓存资源:

https://maps.googleapis.com/…&libraries=places

(30 分钟)

如何将浏览器缓存从 30 分钟提高到更高?

【问题讨论】:

    标签: javascript google-api http-caching


    【解决方案1】:

    从您的服务器使用 CURL 将其作为 php 启动

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-12-04
      • 1970-01-01
      • 1970-01-01
      • 2017-08-23
      • 1970-01-01
      • 2017-08-19
      • 2017-09-05
      • 2016-12-05
      相关资源
      最近更新 更多