new feature: Add "last access time" to `Metadata`
Feature Description
Metadata should have an optional last_access_time field.
Problem and Solution
When implementing a bounded file cache, it's useful to be able to prioritize garbage collection based on access time. I believe most filesystems support this metadata, but regardless we can provide it as an Option.
I would add support for filesystems first. I'm not sure how many object stores could support it.
Additional Context
No response
Are you willing to contribute to the development of this feature?
- [x] Yes, I am willing to contribute to the development of this feature.
I'm guessing only fs has this feature? For file cache gc, is it a good idea to maintain the access inside this cache system so it can work on other non-fs system like redis or moka?
For file cache gc, is it a good idea to maintain the access inside this cache system so it can work on other non-fs system like redis or moka?
That sounds like it would require a new persistent data structure within the storage layer, which may incur significant overhead. It might be feasible to only track access time in memory for caching, but then that information is volatile, which might not work well for some use cases.