Does the Google Map Plugin cache the KML layer being added to a map?

You are here : Home / Does the Google Map Plugin cache the KML layer being added to a map?

I am running a frontend map with a KML file that is contantly being updated throughout the day. unfortunately, the KML file is being updated, but the map is showing the first version of the KML file.

is there a cache system that might be causing this? or is there something you can do to help me?

you can see the map here:

thanks for any support and for a great plugin!

Yeah this is absolutely possible your facing cache issue. I am getting this map right now. Is it right or getting wrong kml.


Thanks for the quick response!

no, that is not the correct map. there should be a red dot in the water to the left of the island.

can you help me deactivate any caching with the KML layers? or maybe set the cache to dump every 1 or 2 hours?

thanks for any advice or help you can give me!

I checked your website source and found you are also using custom kml codes in your site. I think thats why you are facing this issue. Whenever you want to change kml layer you need to change it on kml layers located under layer settings.

thanks for looking into it!

the concept of this section of the website is that users can upload photos on the "Record" page, after which we create a new KML file (maps.kml) with their upload and resave it (maps.kml). then, your plugin renders the KML file (maps.kml) on the "Map" page.

our problem is that after a user uploads, we must change the filenames (maps-1.kml) to get the map to render properly.

can you explain what you mean by "custom kml codes"? is it an issue with the KML file?


No, i mean i found some codes related to kml in your view source.

oh! yes, i forgot to remove the old Google Earth code. it is removed now.

unfortunately it is still showing the wrong version of the KML file. is there something in the plugin causing the cache? and can it be turned off?

I have been working on this same issue for months, and yes google caches kml files. I think for very long periods of time. I have just found what may be a work around, as I also use in the map a link that has the same file name and the underlying data changes daily.
So the workaround I found was to use network link option.
I created a kml file like this

Storm Events -> this is the original layer link
onInterval -> this is the refresh type
300 -> this is interval in seconds minimum is 300 (google)

Name this kml what you like and put it in the map manager klm link mine is like http://mydomain/wp-content/uploads/mynetworklink.kmz

Will see how it goes over the next couple of days to see if my site matches the noa site data.

Ok, I do not know how to answer in the text
So this link is to the page that started me on the answer!topic/kml-support-getting-started/c4PLRQe1Adw
One more try........ for my kml file

[code language="xml"]
<?xml version="1.0" encoding="utf-8"?>
<kml xmlns="">
<name>Storm Events</name>
Hello johnpittman,

Thank you very much for your valuable suggestions, we also tested this issue with both kml/kml at our end and found ,we need to change every time file name then output is change otherwise previous output is displayed everytime.


Yes, I have found that this is unreliable also......
A way to over come is like you say and change the name each time the page is refreshed or on an interval, as some may need frequent or as I do once a day. Maybe you could add code to do this. Some thing like

[code]var URL = filename+"?dummy="+(new Date()).getTime();[/code]

just a thought
thanks for the suggestions john! did your method work for you?

divyang, thanks for testing it out. do you have any suggestions for a workaround?

thank you!
No, it is not reliable with the use of network refresh. Only changing the name seems to work each time. But that is not practical, editing a map in admin mode every day or whatever period you need updates. Short of spending time to figure out a patch for the code, no. My source for kml file always uses the same name with data changed.

The programers are going to need a method so that any time the page is refreshed or an interval has pasted (short), they takes the kml filename from the settings and add a timestamp to the name before sending the request to google maps for update.
example orginal link read data from somesite . com / my.kml to temp file then change it to my20:21:43.kml and request from google with new temp file

Hello Nathnmoyer,
I have discussed with our developer team and they are saying we can solve it. Please provide us your wp login details at

I figured out a way to get google to allow the kml to update, at least it is wotking the last day
At the end of the kml link add ?date();
[code]; [/code]

give it a whirl.

Yeah, that's how we implemented it right now. Please check it and let me know if any issue.
By doing this in manage maps, it worked a couple of times and then it stopped working. I need to change it again in the manage maps.
It needs to go in the actual php code that is calling google. I'm not sure where that is, it looks like maps.js layer_options.
So do you have a modified version of the plugin to try?

Previous we were adding version number in maps.js. Now we have added this in php file put-wpgmp.php. Please let me know if any issue. If any issue, please arrange FTP also so it's safe to do changes.


Please login or Register to Submit Answer

Customize Product according to your requirements?

We will be glad to discuss any of your needs related to our wordpress plugins . if any of functionality you'd like to see in products, you can reach us by via email