Description
Description
The method "setExpiryTime" in the Layer class has the following description:
/**
* Specifies the time of the layer's most recent dataset update. If greater than zero, the layer ignores and
* eliminates any previously cached data older than the time specified, and requests new information from the data
* source. If zero, the layer uses any expiry times intrinsic to the layer, typically initialized at layer
* construction. The default expiry time is 0, thereby enabling a layer's intrinsic expiration criteria.
*
* @param expiryTime the expiry time of any cached data, expressed as a number of milliseconds beyond the epoch.
*
* @see System#currentTimeMillis() for a description of milliseconds beyond the epoch.
*/
And reading through the WorldWind Java Forum there are several posts claiming that using "setExpiryTime(System.currentTimeMillis())" will invalidate a layer's tile cache both in memory and on disc causing new tiles to be retrieved from the source.
However, when I use this method as described nothing seems to happen. Even though the "setExpiryTime" seemed to execute without issue the return value for "tile.getLevel().getExpiryTime()" is the default value of 0 (zero).
Expected behavior:
The documentation says that setting "setExpiryTime(System.currentTimeMillis())" should invalidate the tiles for the specified layer both in memory and on disc and force new tiles to be retrieved from their source.
Actual behavior:
The cached tiles are used instead of fetching the tiles from the source.
Steps to Reproduce
- Call layer.setExpiryTime(System.currentTimeMillis()); for the desired map layer
Reproduces how often:
Always
Operating System and Version
Windows 10 version 1903
Additional Information
Maybe I'm missing something. Are there other flags that need to be set or other calls that need to be made to mark a layer's current cache as expired and force tiles to be downloaded from their source?
Edit
Per Patrick's request I've submitted this issue at the NASA WWJ repo:
NASAWorldWind#174