disable 'timestampMs' map data requests. either i've misunderstood what their code is doing, or it's an incomplete feature in the stock site.
extensive testing has never found an instance where it reduced response size from the server
This commit is contained in:
parent
fcfb60c7e3
commit
51b24386e6
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user