添加过期的标头对于谷歌地图API

时间:2014-04-25 15:03:20

标签: javascript php google-maps google-maps-api-3 yslow

我在google map网站中添加了PHP。现在,我使用Yslow检查我的网页,并在add expired headers中看到:

There are 17 static components without a far-future expiration date.

文件是:

(2014/4/25) http://fonts.googleapis.com/css?...
(2014/4/24) http://maps.gstatic.com/cat_js/intl/en_us/mapfiles/api-3/16/9/%7Bcommon,map,util,marker%7D.js
(2014/4/23) http://maps.gstatic.com/cat_js/intl/en_us/mapfiles/api-3/16/9/%7Binfowindow%7D.js
(2014/4/23) http://maps.gstatic.com/cat_js/intl/en_us/mapfiles/api-3/16/9/%7Bonion%7D.js
(2014/4/23) http://maps.gstatic.com/cat_js/intl/en_us/mapfiles/api-3/16/9/%7Bcontrols%7D.js
(1990/1/1) http://maps.googleapis.com/maps/api/js/ViewportInfoService.GetViewportInfo?...
(2014/4/23) http://maps.gstatic.com/cat_js/intl/en_us/mapfiles/api-3/16/9/%7Bstats%7D.js
(1990/1/1) http://maps.googleapis.com/maps/api/js/AuthenticationService.Authenticate?...
(2014/4/25) http://maps.google.com/maps/api/js?...
(2014/4/25) http://maps.gstatic.com/intl/en_us/mapfiles/api-3/16/9/main.js
(2014/4/25) http://maps.gstatic.com/mapfiles/openhand_8_8.cur
(2014/4/25) http://maps.gstatic.com/mapfiles/api-3/images/google_white2.png
(2014/4/25) http://maps.gstatic.com/mapfiles/api-3/images/mapcnt3.png
(2014/4/25) http://maps.gstatic.com/mapfiles/api-3/images/cb_scout2.png
(2014/4/25) http://maps.gstatic.com/mapfiles/arrow-down.png
(2014/4/25) http://maps.gstatic.com/mapfiles/mv/imgs8.png

如何为Google地图添加过期日期?!

1 个答案:

答案 0 :(得分:0)

您无法更改从Google等其他服务加载的组件的到期日期和缓存设置;您只能真正改善您控制的组件(即从您的服务器)。

在这种情况下,我建议从YSlow测量/等级退一步,从用户的角度看你的应用程序是否足够快。如果不是,可能还有其他最佳做法可以使用您可以实施的Google Maps API。