fsspec / fsspec/filesystem_spec
Refresh local cache when accessed if remote file has been updated
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 490
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 38
Description
From reading the documentation on file-level caching, my understanding is that the only option for expiring the local cache is setting the expiry_time to some fixed value.
However, at least some filesystem backends seem to be able to provide information about the last time a file was modified (e.g. the updated attribute in GCS objects), and it would be convenient if there were a way to only update the local cache when accessing a file if the remote file has been updated since the cache was created.
Is this something that's already possible? I apologize if this is addressed somewhere already, but I searched and didn't find it.
Our use case: We want to publish intake data catalogs for both tagged versions of the outputs from a data pipeline, as well as nightly builds that correspond to various development branches in the pipeline repository. E.g. the outputs from the commit tagged v1.2.3 would be available at gs://intake.catalyst.coop/v1.2.3 while the most recent successful build outputs from the dev branch would be available at gs://intake.catalyst.coop/dev. The tagged version would be static, but the branch reference could change on a daily basis, and it would be good to be able to refresh the local cache automatically if it's updated since the last time it was cached.
I guess maybe this could be done with object versioning too, but I haven't really looked into how that works.
See this issue.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the SimpleCacheFileSystem file-level caching documentation and its expiry_time behavior. Investigate whether filesystem backends expose remote modification timestamps, such as the GCS object updated attribute, and how the cache can compare that value with its local entry. Done means an accessed cached file refreshes only when the remote file has changed, while fixed expiry behavior remains understandable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, cloud
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100