Google-Maps-Implementierung Verursacht Google Page Speed Fragen

Ich bin ein ziemlich Neuling webmaster und habe eine enorme Menge an Hilfe hier aus der wunderbaren Freiwilligen, und ich Schätze Sie alle.

Kürzlich hier jemand (Davie) hat mir geholfen, mit immer einer Google-Karte für die Abfrage der DB und Anzeige auf einer Webseite, aber es ist was Page Speed Probleme, die ich habe kann nicht scheinen, um zu knacken auf meinem eigenen.

Werde ich zusammenfassen; (links absichtlich gebrochen durch das entfernen von 1 t von https zu befriedigen algo hier)
Mit der URL:

http://classifieds.your-adrenaline-fix.com/detail.php?fatherID=37&TypeID=42&ListingID=42

Google Page Speed Sagt;
(Anmerkung Von Mir: Die folgenden urls, die in full Aussehen:

htps://mts0.googleapis.com/vt?lyrs=h@210000000&src=apiv3&hl=en-US&x=36&y=52&z=7&s=&style=api%7Csmartmaps)

Den folgenden Ressourcen inhaltlich identisch, aber werden Ihnen aus unterschiedlichen URLs. Dienen, diese Ressourcen von einer konsistenten URL zu speichern Sie 10 Wunsch(s) und 1,9 Kb.

htps://mts0.googleapis.com/vt?... 
htps://mts0.googleapis.com/vt?... 
htps://mts0.googleapis.com/vt?... 
htps://mts0.googleapis.com/vt?... 
htps://mts0.googleapis.com/vt?... 
htps://mts0.googleapis.com/vt?... 
htps://mts1.googleapis.com/vt?... 
htps://mts1.googleapis.com/vt?... 
htps://mts1.googleapis.com/vt?... 
htps://mts1.googleapis.com/vt?... 
htps://mts1.googleapis.com/vt?... 

Darüber hinaus bin ich immer;

Den folgenden Ressourcen fehlen, eine cache-validator. Ressourcen, die nicht angeben ein cache-validator kann nicht aktualisiert werden effizient. Geben Sie einen Last-Modified-oder ETag-header zu aktivieren cache-Validierung für die folgenden Ressourcen:

htp://www.google.com/.../brand?... 
htps://maps.googleapis.com/.../GeocodeService.Search?... 
htps://maps.googleapis.com/.../StaticMapService.GetMapImage?... 
htps://maps.googleapis.com/.../StaticMapService.GetMapImage?... 
htps://maps.googleapis.com/maps/api/js?sensor=true 
htps://mts0.googleapis.com/vt?... 
htps://mts0.googleapis.com/vt?... 
htps://mts0.googleapis.com/vt?... 
htps://mts0.googleapis.com/vt?... 
htps://mts0.googleapis.com/vt?... 
htps://mts0.googleapis.com/vt?... 
htps://mts0.googleapis.com/vt?... 
htps://mts0.googleapis.com/vt?... 
htps://mts0.googleapis.com/vt?... 
htps://mts0.googleapis.com/vt?... 
htps://mts0.googleapis.com/vt?... 
htps://mts0.googleapis.com/vt?... 
htps://mts0.googleapis.com/vt?... 
htps://mts0.googleapis.com/vt?... 
htps://mts1.googleapis.com/.../ft?... 
htps://mts1.googleapis.com/.../ft?... 
htps://mts1.googleapis.com/.../ft?... 
htps://mts1.googleapis.com/vt?... 
htps://mts1.googleapis.com/vt?... 
htps://mts1.googleapis.com/vt?... 
htps://mts1.googleapis.com/vt?... 
htps://mts1.googleapis.com/vt?... 
htps://mts1.googleapis.com/vt?... 
htps://mts1.googleapis.com/vt?... 
htps://mts1.googleapis.com/vt?... 
htps://mts1.googleapis.com/vt?... 
htps://mts1.googleapis.com/vt?... 
htps://mts1.googleapis.com/vt?... 
htps://mts1.googleapis.com/vt?... 
htps://mts1.googleapis.com/vt?... 
htps://mts1.googleapis.com/vt?... 
htps://mts1.googleapis.com/vt?...

Ich hoffe, dass jemand hier kennt und vielleicht eine Idee haben, wie könnte ich diese Probleme beheben.

Dies ist der code auf detail.php

$TypeID = isset($_GET['TypeID']) ? $_GET['TypeID'] : ''; 
            $ListingID = isset($_GET['ListingID']) ? $_GET['ListingID'] : ''; 
            $allowed_tables = array('tt_42', 'tt_43');
            $table ="tt_".$TypeID;
            $dbh = new PDO("mysql:host=$host;dbname=$db", $username, $password);
            $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

      try {
        if (in_array($table, $allowed_tables)) {
        $query = "SELECT `Address`, `City`, `State/Province`, `Zip/Postal`, `Country` FROM `$table` WHERE `ID` = ? AND `ExpireDate` > NOW()";
        }
                $stmt = $dbh->prepare($query);
                $stmt->bindParam(1,$ListingID);
                $stmt->setFetchMode(PDO::FETCH_ASSOC);
                $stmt->execute();

                $Address = $listing['Address'];
                $City = $listing['City'];
                $State = $listing['State/Province'];
                $Zip = $listing['Zip/Postal'];
                $Country = $listing['Country'];

                echo '<h2>Map of Surrounding Area With Navigational Aides</h2>';
                echo '<div class="CalloutBoxBlue">Hover over map and scroll, or use + and - in LH corner of map to zoom or expand viewing area. Alternatively, hold down mouse to manually move the map to a different geographical location, or drag the person icon to a specific location on the map for a street view.</div>';

                echo '<div id="GoogleMap">'; 
                echo '<iframe scrolling="no" style="width:480px; height:300px; border:0px;" frameborder="0" src="googlemap.php?Address='.$Address.'&amp;City='.$City.'&amp;State='.$State.'&amp;Zip='.$Zip.'&amp;Country='.$Country.'"></iframe>'; 
                echo '</div>'; 
            }

            catch(PDOException $e) {
                echo "Error in Displaying Google Map.". $e->getMessage() ;//Remove or modify after testing 
                //file_put_contents('PDOErrors.txt',date('[Y-m-d H:i:s]').", mapSelect.php, ". $e->getMessage()."\r\n", FILE_APPEND);  
             }

Zusätzlich, das ist der code von googlemap.php

<!DOCTYPE html>
    <html>
    <head>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <style type="text/css">
      html { height: 100% }
      body { height: 100%; margin: 0; padding: 0 }
      #map { height: 100% }
    </style>

    <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=true">
      var geocoder;
      var map;
     <?php
      //Get parameters from URL
      $Address = isset($_GET['Address']) ? $_GET['Address'] : ''; 
      $City = isset($_GET['City']) ? $_GET['City'] : ''; 
      $State = isset($_GET['State']) ? $_GET['State'] : ''; 
      $Zip = isset($_GET['Zip']) ? $_GET['Zip'] : ''; 
      $Country= isset($_GET['Country']) ? $_GET['Country'] : '';

      //Set javascript variables
      echo "var Address ='".$Address."';\n"; 
      echo "var City ='".$City."';\n"; 
      echo "var State ='".$State."';\n";
      echo "var Zip ='".$Zip."';\n"; 
      echo "var Country ='".$Country."';\n";
?>
  function initialize() {
        geocoder = new google.maps.Geocoder();
        var latlng = new google.maps.LatLng(0,0);
        var mapOptions = {
          zoom: 7,
          center: latlng,
          mapTypeId: google.maps.MapTypeId.HYBRID
        }
        map = new google.maps.Map(document.getElementById('map'), mapOptions);
        codeAddress();
      }

      function codeAddress() {
        var address = Address+','+City+','+State+','+Zip+','+Country;
        geocoder.geocode( { 'address': address}, function(results, status) {
          if (status == google.maps.GeocoderStatus.OK) {
            map.setCenter(results[0].geometry.location);
            var marker = new google.maps.Marker({
                map: map,
                position: results[0].geometry.location
            });
          } else {
            alert('Location not acquired for the following reason: ' + status);
          }
        });
      }
    </script>

  </head>
  <body onload ="initialize()">
    <div id="map" style="width:100%; height:100%"></div>
  </body>
</html>

Ich weiß nicht, ob es wirklich noch 100% relevant, aber ich habe auch Folgendes in meine htaccess für die Zwischenspeicherung von Ressourcen:

<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On 
# Default directive
ExpiresDefault "access plus 1 year"
# Favicon
ExpiresByType image/x-icon "access plus 1 year"
# Images
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
# CSS
ExpiresByType text/css "access 1 month"
# Javascript
ExpiresByType application/javascript "access plus 1 year"
</IfModule>

Ich hoffe, dass dieses simplya Angelegenheit benötigen, fügen Sie eine Zeile code zu meiner htaccess. Wenn dem so ist, weiß ich nicht, was ich hinzufügen würde, und wenn jemand könnte mir dabei helfen, wäre ich sehr dankbar.

  • Hallo Allerseits, vielen Dank für den edit. "Mein Bad"
  • Ist Sie Karte funktioniert OK und es ist nur, dass der Google Page Speed beschwert sich über die Google-Ressourcen, die von der Google Maps API lädt? Ich glaube nicht, können Sie etwas dagegen tun. Ignorieren Sie es.
  • Ich habe das gleiche problem. Meine eingebettete Google-Karte funktioniert einwandfrei, aber PageSpeed sagte mir zu dienen, eine Ressource eine eindeutige URL, die zu beseitigen Sie doppelte herunterladen bytes und zusätzliche RTT.". Ja, ich kann es ignorieren, aber es wird gezeigt, wie eine hohe Priorität und es ist nicht gut, vom Standpunkt der Qualität aus gesehen
InformationsquelleAutor | 2013-03-22
Schreibe einen Kommentar