-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to Refresh Map Layer Cache with "setExpiryTime" #73
Comments
Oooh! I like this one! Good stuff! |
I decided to take another approach to the problem I was trying to resolve: providing a method for a client to delete local tile cache for a selected map. But the issue described above still exists, and I would consider it to be a "bug" (at least based on the documentation). However, I wonder if the "setExpiryTime" method only works if a layer's XML config file contains a "LastUpdate" node? Our layers do not contain this node. I suppose it might be possible that the "setExpiryTime" method requires the existence of this node. I'm pretty swamped at the moment, but I hope to be able to test this before too long. |
[I hear from others] |
@robmilton, maybe this can be tackled in a 2.3.0 release. |
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
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
The text was updated successfully, but these errors were encountered: