Why does rclone serve have a VFS cache option?

What is the problem you are having with rclone?

Why does rclone serve have an option for VFS cache? Why would serving files need a cache? Can someone explain it to me?

For example rclone serve sftp has it as an option: rclone serve sftp

If you click on the link, it goes through the modes and explains what each does.

If you are just reading files, you may or may not want a cache as that's really up to you.

If you are writing, depending on what the application is requesting, you may need a cache mode to support that as if required, it would be written in the logs.

I understand what the VFS cache is for when mounting a remote. But rclone serve is a file server, and it still has options to create a VFS cache. This is what I don't understand. Why does serving files have an option for the VFS cache? I understand why rclone mount has this option.

Both are pretty much the same as one is presenting via an external protocol (SFTP) in your example and a mount is a disk.

Really no difference as the cache would be the same for both patterns so you can choose to use or not use it depending on your needs. If you don't need it, don't use a cache.

I did some testing and they work differently. If you mount a rclone serve with the vfs cache writes/full option, then it seems most/all file operations are supported (like downloading a file using jdownloader in multiple parts).

If you put a full vfs cache on the serve itself, but mount that serve without a vfs cache, then the extra file operations aren't supported.

What seems to happen when copying a file to rclone serve with the full vfs cache options is that the file being transferred is first copied to the cache on the server then is transferred to the destination. I am not sure what the point of this is exactly, it seems to be pointless?

It really depends on your use case.

If the SFTP is in the same box, probably makes little sense.

If the server is remote, it acts like a cache and you save a download.

So depends on your scenario so use it or don’t depending on your specific needs.

Ah I see, for example files from a cloud drive could be cached on the server to decrease read calls. Thanks, this makes sense now.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.