Feature Request - Caching Support

I would like to propose adding the ability to allocate a set amount of space on nodes to cache frequently used files (or ideally blocks) to essentially act as a CDN.

Use Case:

  1. Allow users to spin up inexpensive nodes in the cloud to increase transfer speeds, while only having local “full” nodes given cloud storage is relatively expensive.

  2. Allow users selectively syncing folders in a broader syncthing network to contribute a small amount of space to help other peers.

Implementation ideas:

  1. The easiest way to implement this would be to have a LRU cache of all the files that a node ever transmitted to other nodes. This would be independent of the current folder selection (if a node stopped syncing a folder, some contents of that folder might remain in the cache), but would probably only work well on relay nodes.

  2. The better, but more difficult implementation would be to have some centralized tracking of which files are most often requested and proactively sending those to the caches of nodes that may not have already requested them yet. This would work best for use case 2 as it would allow more organic caching rather than having dedicated nodes.

1 Like

This has been discussed, but syncthing is not a cache and not a cdn, it syncs files.

You can spin up machines in the cloud and store the whole dataset if you want “accelerate” or whatever.

There is nothing in the protocol preventing you from implementing something like this, but I don’t think it will ever be part of the base application just because it would add unneeded complexity and maintenance headache in an already fairly complicated application.

Something like that is best done as a separate application (even if just a binary that reuses existing go libraries).

1 Like