WordPress.org

Ready to get started?Download WordPress

Forums

Geo Mashup
[resolved] Is external kml loaded through custom.js cached? (3 posts)

  1. jamesinealing
    Member
    Posted 1 year ago #

    Hi

    I have a dynamic map of all geotagged blog posts onto which I have overlayed geotagged tweets by creating a dynamic kml feed and loading it through custom.js (using the Google v3 example at http://code.google.com/p/wordpress-geo-mashup/wiki/Documentation#JavaScript_API)

    In testing I am having a problem in that when I post new tweets or change the format of the kml the updates are not being reflected on the map. Is the kml data (or in fact the custom.js file) cached somewhere? If so, for how long? That said, I think I've found a way around it by renaming files but it's not ideal.

    Thanks, James

    http://wordpress.org/extend/plugins/geo-mashup/

  2. Dylan Kuhn
    Member
    Plugin Author

    Posted 1 year ago #

    Google caches KML files, and recommends doing exactly what you've done:

    http://code.google.com/p/gmaps-api-issues/issues/detail?id=4196

    Geo Mashup doesn't try to cache custom.js - it should be handled the same as other javascript files.

  3. jamesinealing
    Member
    Posted 1 year ago #

    Aghhhh, face-palm. Sorry, it's been a year or more since I worked with Google Maps and loading kml!

    I've just implemented a couple of lines in custom.js

    var cachetime = 180;  //desired cache time in seconds
    var param = Math.round(+new Date()/1000/cachetime);

    and then append ?t= + the value of param onto the kml call - I thought I wouldn't overwrite the caching entirely. Seems to work well now.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic