diff --git a/code/map_data_cache.js b/code/map_data_cache.js index 6dcda1a8..d6868557 100644 --- a/code/map_data_cache.js +++ b/code/map_data_cache.js @@ -9,7 +9,9 @@ window.DataCache = function() { // for, retrieving deltas) so use a long max age to take advantage of this // however, ther must be an overall limit on the maximum age of data from the servers, otherwise the deletedEntity // entries would grow indefinitely. an hour seems reasonable from experience with the data, so 55 mins max cache time - this.REQUEST_CACHE_MAX_AGE = 55*60; // maximum cache age. entries are deleted from the cache after this time +// this.REQUEST_CACHE_MAX_AGE = 55*60; // maximum cache age. entries are deleted from the cache after this time +//UPDATE: this timestampMs parameter doesn't work, so reduced max age to limit RAM usage + this.REQUEST_CACHE_MAX_AGE = 5*60; // maximum cache age. entries are deleted from the cache after this time if (L.Browser.mobile) { // on mobile devices, smaller cache size diff --git a/code/map_data_request.js b/code/map_data_request.js index ff839663..79ce5599 100644 --- a/code/map_data_request.js +++ b/code/map_data_request.js @@ -252,6 +252,9 @@ window.MapDataRequest.prototype.refresh = function() { lngEast ); +/* After some testing, this doesn't seem to actually work. The server returns the same data with and without the parameter + * Also, closer study of the stock site code shows the parameter isn't actually set anywhere. + * so, disabling for now... // however, the server does support delta requests - only returning the entities changed since a particular timestamp // retrieve the stale cache entry and use it, if possible var stale = (this.cache && this.cache.get(tile_id)); @@ -275,6 +278,7 @@ console.log('stale tile '+tile_id+': newest mtime '+lastTimestamp+(lastTimestamp boundsParams.timestampMs = lastTimestamp; } } +*/ this.tileBounds[tile_id] = boundsParams; this.requestedTileCount += 1; @@ -504,6 +508,7 @@ window.MapDataRequest.prototype.handleResponse = function (data, tiles, success) var stale = this.requestedTiles[id].staleData; if (stale) { +//NOTE: currently this code path won't be used, as we never set the staleData to anything other than 'undefined' // we have stale data. therefore, a delta request was made for this tile. we need to merge the results with // the existing stale data before proceeding