Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Unexpected cache behavior when loading kml files
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Expand all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
iS  
View profile  
 More options Jun 15 2007, 2:29 pm
From: iS <ingo.sei...@gmx.at>
Date: Fri, 15 Jun 2007 11:29:39 -0700
Local: Fri, Jun 15 2007 2:29 pm
Subject: Unexpected cache behavior when loading kml files
Hello!

I have a problem with the loading of kml files via the GGeoXml class.
Essentially I have a web page with a Google Map, a GGeoXml layer
(accessing web address "http://randhost.edu/file.kml") and one button
"refresh". When the "refresh" button is clicked, a cgi script is
called which generates a new kml file at the address "http://
randhost.edu/file.kml". The user is then redirected to the map page
and the new kml data should be loaded with the GGeoXml layer. Now this
works perfect for the first click on button "refresh", but subsequent
calls yield the same data in the GGeoXML layer, although the content
in the kml file at address "http://randhost.edu/file.kml" has changed.

After (some long) troubleshooting, I found out that this behavior
seems not to be caused by my programming, but by the way how Google
Maps handles kml links. I tried the following: I went to
maps.google.com and entered a web link to a kml file - "http://
randhost.edu/someKMLFile.kml". As expected the placemark contained in
this file gets displayed. When I now delete the file "someKMLFile.kml"
and click on the "search" button again, the site is refreshed and the
placemark still gets displayed, although the kml link that I am
opening does not exist anymore! It takes approximately 4 minutes until
the message "File not found at http://randhost.edu/someKMLFile.kml"
shows up. During these 4 minutes however I still can access the non
existent web link.

My guess is now that Google caches these kml links and stores their
content somewhere. When the file under the kml link changes this will
be ignored by Google and only after some specified amount of time
Google reloads the kml link into its cache. Are these assumptions
correct and has anyone else experienced problems with this behavior?
Is it possible to disable this caching behavior and force Google to
access the original kml link whenever a new request to the link is
issued?

thanks

iS


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Barry Hunter  
View profile  
(1 user)  More options Jun 15 2007, 2:41 pm
From: "Barry Hunter" <barrybhun...@googlemail.com>
Date: Fri, 15 Jun 2007 19:41:55 +0100
Local: Fri, Jun 15 2007 2:41 pm
Subject: Re: Unexpected cache behavior when loading kml files

Yes they do cache the KML.

A simple way round it is to add a random paramater to the URL, your server
will just ignore it, but Google sees it as a different url, so has no option
but to fetch it again.

"http://randhost.edu/file.kml?rand="+(new Date()).valueOf()

which should add the current millisecond to the URL, which is probably
random enough.

On 6/15/07, iS <ingo.sei...@gmx.at> wrote:

--
Barry

- www.nearby.org.uk - www.geograph.org.uk -


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
iS  
View profile  
 More options Jun 15 2007, 3:02 pm
From: iS <ingo.sei...@gmx.at>
Date: Fri, 15 Jun 2007 12:02:06 -0700
Local: Fri, Jun 15 2007 3:02 pm
Subject: Re: Unexpected cache behavior when loading kml files
Thanks for the reply, this solution works perfectly!

Does anyone know why they do not check if there is new data available
before
they provide outdated data? And why are such exceptions not mentioned
in the
API, if I want to access a file via the GGeoXml class then I want it
to be exactly
that file and not a magically cached old version of the same file.

iS


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Papa Bear  
View profile  
 More options Jun 15 2007, 3:25 pm
From: Papa Bear <papabear.newy...@gmail.com>
Date: Fri, 15 Jun 2007 19:25:58 -0000
Local: Fri, Jun 15 2007 3:25 pm
Subject: Re: Unexpected cache behavior when loading kml files
Most browsers will ignore changes when the URL doesn't change.  On FF
and NS (maybe others), you can hit shift-reload and it will check.
Don't know if there's a way to do that from JS. I use the hash portion
of the URL to record my internal state changes (and to allow me to go
back with the back button), but if I don't change the URL, nothing
happens.

I just thought that's the way it works  Without caching, things would
grind to a halt.  <grin>.

On Jun 15, 3:02 pm, iS <ingo.sei...@gmx.at> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google