-
Notifications
You must be signed in to change notification settings - Fork 43
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
Disable all caching #1206
Comments
I'm wondering if it would be easiest to implement a "dummy cache" that always misses that users can opt in to |
Here is a hacky way to do it: |
A better hack is probably: |
Actually, this won't work right -- we'd have to override the |
The first approach fixes the problem for me! |
It will break pickling the tile source, so we still might want to define a config value to do this more correctly. |
When opening a tile source, pass `noCache=True`. In this mode, the tile source can directly have its style modified (e.g., `source.style = <new value>`). This is also used when importing images into girder to avoid flushing the cache of tile sources that are in active use. This closes #1294. This closes #1145. There is a config value `cache_sources`, that, if False, makes `noCache` default to False. This closes #1206.
When #1296 is merged, this can be accomplished with a config setting. This will NOT break pickling the tile source. |
There are use cases for local computation where caching isn't desired. Caching is excellent for stateless environments where multiple users may be requesting tiles/thumbnails of the same image repeatedly or even in local environments when dealing with non-pre-tiled datasets. However, caching introduces unexpected results and stale data in local, stateful environments (like me as a single user in a Jupyter Notebook).
For example, I want to experiment with an algorithm to interactively to produce a new raster and call it
"ndvi.tif"
. I want to toy with the algorithm: tinker with the computation, re-run, overwriting the existing data, and visualize the result withlarge_image
to see how my changes to the algorithm affected the result.This scenario wouldn't be a problem if I set up some temporary file mechanism to save a new temp file for every computation, and in effect have large_image open a new file on each iteration. But I don't want to do this. I don't want to save tons of new files. I want one working file.
The trouble is, large_image caches the tile source, and this workflow isn't possible.
To simplify the testing of this, I have two versions of the same image,
ndvi-09.tif
andndvi-11.tif
, which I will save asndvi.tif
and attempt to reload with large_imagendvi-09.tif
ndvi-11.tif
The solution given in #985 isn't sufficient as there is still some caching going on that prevents large-image from re-opening the same path as a new tile source
Uh oh! That thumbnail above isn't right! It's using the cached tile source even though restricted the cache constraints.
The text was updated successfully, but these errors were encountered: