我在PHP
网站中添加了google map
。现在,我使用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等其他服务加载的组件的过期日期和缓存设置;您只能真正改善您控制的组件(即,从服务器)的性能。
在这种情况下,我建议从YSlow的测量/等级后退一步,从用户的角度来看,看看你的应用程序是否足够快。如果不是这样,可能还有其他使用谷歌地图API的最佳实践可以实现。