Google Maps API causes page loss

I’m working on optimizing the Page Speed score , and I found that loading Google Maps gives 5 points. He complains about a number of things, but the one that causes the yellow dot is the lack of a cache validator in most of the loaded resources.

To exclude all that I could do, I launched Page Speed ​​against the simplest possible map - Hello World from the Google Maps documentation. Of course, he receives the same warning as on my site. Run page speed to see warnings.

https://google-developers.appspot.com/maps/documentation/javascript/examples/map-simple

Can these warnings be fixed? Or, in general, is it possible for any page with a Google Map to reach 95 Page Speed?

+8
google-maps google-maps-api-3
source share
1 answer

My best results with this simple map are 81/95 (Mobile / Desktop).

The following example gives 81/94.

<!DOCTYPE html> <html> <head> <title>Simple Map</title> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> <meta charset="utf-8"> <style> html, body, #map-canvas { height: 100%; margin: 0px; padding: 0px; } </style> </head> <body> <div id="map-canvas"></div> <script> var map; function initialize() { var mapOptions = { zoom: 8, center: new google.maps.LatLng(-34.397, 150.644) }; map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); } function loadScript() { var script = document.createElement('script'); script.type = 'text/javascript'; script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp&callback=initialize'; document.body.appendChild(script); } window.onload = loadScript; </script> </body> </html> 

I was able to get a +1 point to my desktop score by uploading a Google Maps file through a proxy.

0
source share

All Articles