pyfilesystem icon indicating copy to clipboard operation
pyfilesystem copied to clipboard

There should be a caching wrapfs

Open hmeine opened this issue 10 years ago • 7 comments

For networking-based filesystems, one is often interested in some kind of local cache. As far as I can see, that would be another good use case for fs.wrapfs, right?

hmeine avatar Nov 23 '15 11:11 hmeine

Yes fs.wrapfs would be perfect. The implementation really depends on what type of filesystem you're trying to wrap and your use case though.

travcunn avatar Dec 09 '15 18:12 travcunn

There are classes for caching single files and filesystem metadata, but not complete filesystem: https://github.com/PyFilesystem/pyfilesystem/blob/master/fs/remote.py

arekbulski avatar Dec 10 '15 01:12 arekbulski

Yes, I think CacheFS comes close, but I would like to have an additional cache of files that were read. So, one would configure a local cache directory and maximum cache size (after which the oldest files are purged), and all files would first be copied there and reused instead of re-downloaded. The metadata would obviously be solved by CacheFS[Mixin] already.

hmeine avatar Jan 06 '16 17:01 hmeine

Hi,

I'm working on a WrapFS subclass implementing the LRU caching scheme (wikipedia entry). On top of the wrapped FS, one provides another FS used for caching and the max size of the cache. The consistency is checked based on md5, so it's compatible with s3's etag. Would you consider a pull request when I'm done?

M.

mguillau avatar Feb 29 '16 18:02 mguillau

I think you could close this issue, unless you have some code to submit. You made a point.

arekbulski avatar Aug 01 '16 20:08 arekbulski

IMHO this is a perfectly valid suggestion / request, so there's no point closing it.

lurch avatar Aug 01 '16 20:08 lurch

I agree. Some maintainers close less prospective issues when there is no active work to discuss.

arekbulski avatar Aug 01 '16 20:08 arekbulski