Replies: 2 comments 2 replies
-
Cool idea, thanks for asking! At the most basic level, stac-asset does "caching" by skipping already-existent local paths: stac-asset/src/stac_asset/_functions.py Line 50 in ec56b86 It wouldn't be hard to implement a "no newer than" feature to compliment the "overwrite" behavior -- i.e. "Is this asset old? If so, re-download. If not, don't". That would be cool. A system-level asset cache is an interesting idea, and could be within scope. Uniquely identifying the assets shouldn't be too hard ( Tl;dr: cool idea, PRs welcome ✌🏼. |
Beta Was this translation helpful? Give feedback.
-
I like this idea too @nickrsan. Some ?s:
I'd think that the cache could be rebuilt on initialization from an existing local path and an ItemCollection, but then how is usage determined? |
Beta Was this translation helpful? Give feedback.
-
Hi there,
Thanks for the work on this addition to the STAC ecosystem. I'm wondering about the possibility of adding an adaptive caching mechanism either within
stac-asset
or possibly as anotherstac-util
repository - the goal being that I can have a persistent cache of downloaded assets where the least used items get evicted to make space for new downloads, ideally setting the hrefs on theItem
classes back to the original paths so they can continue to be used as before (and downloaded again, if accessed).I can see arguments for both enhancements within
stac-asset
and also a separate library that gets initialized with a collection frompystac-client
and with downloading functionality fromstac-asset
, and then has a transparent layer that manages data access so that when you go to access the asset file locally, it downloads it if needed and then returns the local filepath, evicting anything needed from your local cache in the process.Do you know if any discussions along these lines have been had already by STAC contributors? We have development time to devote to this and are happy to do the bulk of the work, but I'd ideally like to integrate it into the existing STAC ecosystem in the best way possible, so wanted to start with a discussion item rather than a formal feature request/issue, since I'm not yet sure if this is the repository where it should be integrated. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions