9

I have over 20 kml/kmz files that I let users add to a Google Maps (ver 2). I know that if I modify the kml file, Google has it cached and won't update it immediately unless you change the file's name.

How long will it be before Google Maps updates its cache?

If it updates its cache within a month, then for minor changes to my KML files I can avoid updating my file names.

Aaron Kreider
  • 1,705
  • 5
  • 22
  • 44

2 Answers2

11

See here: http://code.google.com/apis/kml/documentation/kmlelementsinmaps.html

Expiration and time-based refresh are generally supported, although Google Maps does not refetch content from the Internet more often than (in the order of) fractions of a minute to a few minutes. Google Maps ignores expiration settings in the HTTP headers but does use the expiration settings specified in KML. In the absence of expiration settings, or within the time validity interval, Google Maps may cache data fetched from the Internet for unspecified durations. A refetch of the data from the Internet can be forced by renaming the document and fetching it under a different URL, or by making sure that the document contains appropriate expiration settings.

Basically they don't specify an exact time for the duration of their cache. However I believe from experience that it is in the order of minutes and not months.

supakeen
  • 2,876
  • 19
  • 19
1

You can create a kml file as follow, input the link to your source kml file between the <href> tags, and use this file as the kml of your map. By doing this, the file between the <href> tags will be refreshed every hour.

<kml xmlns="http://earth.google.com/kml/2.1">
  <NetworkLink>
    <Link>
      <href> [your_source_kml_link] </href>
      <refreshMode>onInterval</refreshMode>
      <refreshInterval> 3600 </refreshInterval>
    </Link>
  </NetworkLink>
</kml>
Joe Cheng
  • 8,804
  • 3
  • 26
  • 25