Bioconductor/BiocFileCache

Brainstorming: multiple cache locations handled like .libPaths()

Closed this issue · 2 comments

Following a chat with @lshep here is an idea that crossed my mind, and that I offer for discussion.

First observation:

  • Similarly to .libPaths(), it can be appealing for groups to have a 'central' cache (e.g. avoid each person in a group to cache the TENxBrainData data set. Instead have a central one accessible by everyone)

Second observation:

  • again, similarly to .libPaths(), rather than having a single location (potentially the 'central' one described above), it may be attractive to have an array of location
    • in order of priority, that can be iteratively scanned ("if the resource is not available in the central cache, check my private cache, otherwise download it in [central|private|other] cache")
    • to stratify resources (e.g. 'central', 'personal', maybe even 'annotations', etc.)
lshep commented

For now I think the decision was to leave the implementation as is. It is quite difficult to have the idea of merging multiple cache locations. We have encountered problems in the past concerning the multiple .libPaths with regards to updating and permissions and seems like we would potentially encounter something similar here.

It is feasible to do something with a little more manual work by having two defined bfc object - granted slightly more work for the user to have to look for and manage two but
bfccentral <- BiocFileCache("some/centralized/accessible/path")
bfcpersonal <- BiocFileCache("/home/user/somelocallocation")

Thanks for having given some thought to the idea.
Indeed, I can also picture those issues similar to .libPaths that would significantly complicate the management of the caches and create some painful conflicts.
Unless a real demand/scenario arises, it's probably better to leave this concept aside. I found it an interesting thought experiment though.