title: Cache expiration with kml files and google maps
body: <p>I have some dynamically generated KML files that I'd like to display on Google Maps. That's the easy part, I've done it a few times before, no problem.</p>
  
  <p>What I want is for the KML files to only be cached by Google for a request. That is to say, if a person visits a page with a Google Maps embed, which has my KML loaded and displayed, I want that KML file to be used for that page load. But if the user were to refresh the page (having the same Google maps URL), I would like the KML file to be re-fetched.</p>
  
  <p>The simple "just add a timestamp argument" doesn't work, as I'm not going to be in control of the urls passed to Google Maps on the page (just most of the url).</p>
  
  <p>Looking at the <code>&lt;Link&gt;</code> and <code>&lt;networkLink&gt;</code> tags, they seem to let you control expiration, caching, refresh, etc., on an external resource. Reading the documentation, it would <em>seem</em> that using <code>&lt;refreshMode&gt;onChange&lt;refreshMode&gt;</code> to use a two-layered approach will get me what I want.</p>
  
  <p>After testing this, Google isn't actually refreshing the content of the linked KML file, even after 10-20 minutes and multiple maps reloads (when I provide the same url to the Maps search box).</p>
  
  <p>These are the KML files that I am using:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;kml xmlns="http://www.opengis.net/kml/2.2"&gt;
  &lt;Document&gt;
    &lt;NetworkLink&gt;
      &lt;Link&gt;
        &lt;href&gt;URL&lt;/href&gt;
        &lt;refreshMode&gt;onChange&lt;/refreshMode&gt;
      &lt;/Link&gt;
    &lt;/NetworkLink&gt;
  &lt;/Document&gt;
  &lt;/kml&gt;
  </code></pre>
  
  <p>...</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;kml xmlns="http://www.opengis.net/kml/2.2"&gt;
  &lt;Document&gt;
      &lt;Placemark&gt;
          &lt;name&gt;NAME&lt;/name&gt;
          &lt;visibility&gt;1&lt;/visibility&gt;
          &lt;Style&gt;
              STYLE
          &lt;/Style&gt;
          GEOMETRY
      &lt;/Placemark&gt;
  &lt;/Document&gt;
  &lt;/kml&gt;
  </code></pre>
  
  <p>... With URL, NAME, STYLE, and GEOMETRY replaced with correct content. Does anyone have an idea of what I might be doing wrong? Or if what I want is possible?</p>