logo
Ask your WordPress questions! Pay money and get answers fast! (more info)

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.

$7
Problems with caching of URLs containing "?"

I am the developer of mapsmarker.com & a user got a problem with the newly added feature of Google Maps support. He receives the message "" The Google Maps API server rejected your request. The "sensor" parameter specified in the request must be set to either "true" or "false". "

I use wp_enqueue_script to load the Google Maps JS:

if ( defined('WPLANG') ) { $lang = substr(WPLANG, 0, 2); } else { $lang = 'en'; }
wp_enqueue_script( 'leafletmapsmarker-googlemaps', 'http://maps.google.com/maps/api/js?v=3.2&sensor=false&language='.$lang);


On my server, this works fine, the output in <head> is

http://maps.google.com/maps/api/js?v=3.2&sensor=false&language=en&ver=3.4.1


On the server of my user, the URL gets cut before the ?:

http://maps.google.com/maps/api/js


My user said, that as per Google's Web Page Performance Audit, resources with a "?" in the URL are not cached by most proxy caching servers.

How can I embedd the script in order to also support most proxy caching servers?
Any help is appreciated!

Robert Harm | 07/15/12 at 11:34am Edit
Tutorial: How to assign prize money


(2) Possible Answers Submitted...

See a chronological view of answers?

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

  • avatar
    Last edited:
    07/15/12
    11:43am
    sabby says:

    Hi,
    Did you find the solution from google if not then use this link

    https://groups.google.com/forum/?fromgroups#!topic/google-maps-api/QoYObdWWakE

    Hope this will help you.

    • 07/15/12 11:47am

      Robert Harm says:

      thanks, but doesnt really help - I dont have new lines within my code...

    • 07/15/12 11:54am

      sabby says:

      Can you paste your code or give me the url :

    • 07/15/12 11:55am

      Robert Harm says:

        function lmm_frontend_enqueue_scripts() {
      $plugin_version = get_option('leafletmapsmarker_version');
      wp_enqueue_script( array ( 'jquery' ) );
      wp_enqueue_script( 'leafletmapsmarker', LEAFLET_PLUGIN_URL . 'leaflet-dist/leaflet.js', array(), $plugin_version);
      wp_localize_script ( 'leafletmapsmarker', 'leafletmapsmarker_L10n', array(
      'lmm_zoom_in' => __( 'Zoom in', 'lmm' ),
      'lmm_zoom_out' => __( 'Zoom out', 'lmm' )
      ) );
      if ( defined('WPLANG') ) { $lang = substr(WPLANG, 0, 2); } else { $lang = 'en'; }
      wp_enqueue_script( 'leafletmapsmarker-googlemaps', 'http://maps.google.com/maps/api/js?v=3.2&sensor=false&language='.$lang);
      }


      Add url: on www.mapsmarker.com it is working - my user already made a workaround, so that on EdWeWo.com it also works

    • 07/15/12 12:10pm

      sabby says:

      Hi Dear,
      I didn't understand this But I can say one thing about this:

      I open your header.php and on line number 58 I found this code

      <script type='text/javascript' src='http://maps.google.com/maps/api/js?v=3.2&#038;sensor=false&#038;language=en&#038;ver=3.4.1'></script>


      When I try open this link then I found the error as
      alert("The Google Maps API server rejected your request. The \x22sensor\x22 parameter specified in the request must be set to either \x22true\x22 or \x22false\x22.")

      So the conclusion is when I solve this by add modifying your script file with the below code :

      <script type='text/javascript' src='http://maps.google.com/maps/api/js?v=3.2&sensor=false&language=en&#038;ver=3.4.1></script>


      and it shows some code on browser.

      https://github.com/egeloen/IvoryGoogleMapBundle/commit/ebfb0240331cdf0e90a4f9f16ac623889d2a3ae9

    • 07/15/12 2:58pm

      Robert Harm says:

      doesnt help either unfortunately

    • 07/15/12 3:04pm

      sabby says:

      It must, Solve try again, I had checked it,

      Or if you give access of admin panel then It would be great for me to search error.

      if yes then mail me the details
      sabirsoftware@gmail.com

  • avatar
    Last edited:
    07/18/12
    11:20am

    This answer was downvoted by the top experts.

This question has expired.





Current status of this question: Community pot



Please log in to add additional discourse to this page.





Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.