Cache - ability to purge directory cache without purging cached files?

I’ve thought about this before.

There are some basic things that people have asked for lots of times, eg being able to change the bwlimit on the fly.

Rclone has a web serving interface in cmd/serve/httplib which does all the hard parts (eg authentication, TLS etc).

What I imagine is that the user would need to provide the --rc flag (lets say) and if they did rclone would start a remote control server on a default port (or you could specify it).

Then we’d have an internal API so that potential users of the remote control could hook themselves into and out of it. That could include the “bwlimit” mentioned above as well as other things… The uers might register a subsystem, eg “bwlimit” and some commands for that subsystem, eg “get”, “set”.

The external API would be some REST-ish interface giving and returning JSON blobs most likely, though being able to be flexible to take things as parameter strings might be a good idea.

We’d then make an rclone command rclone rc maybe so you could act on the registered rpc, eg rclone rc bwlimit set 100k or rclone rc mount flush-cache.

What do you think?