How to exclude all cache folders from backup?

Continuing the discussion from Help with filters file (I attached my file):

I have been using this for a while now but it suddenly occurs to me that this might be to broad as it will not only exclude cache folders but any path that somewhere includes the string cache. So for example, My important documents/xyzcache.docwill be excluded, right?

So I’m wondering what might be a better formula here?

Using e:(?i).*cache.*/.* would at least ignore file names but I think that is still to greedy for my liking. So what assumptions can we make about “real” cache folders, i.e. those that we really want to exclude? Can we assume that they will have the word cache either at the beginning or the end of the directory name? Then this could work:

e:(?i).*(/cache.*|.*cache/.*)

Or am I missing something?

A related thought: one thing that everyone definitely wants to avoid, no matter what, is to prevent duplicacy from backing up locally cached duplicacy chunks. This should be achieved by the above formula for excluding cache folders, but I’m thinking that this is so important that duplicacy should actuaööy come with this already built in, not hard coded, of course, but there should be a default filter file that transparently does this, for example by inlcuding this default exclusion:

e:(?i).*/chunks/([a-z]|\d){2}/

What do you think, @gchen?

Oh, well, I just realize that including such a file will not work with the current release format (single executable), but anyway: maybe this could be recommendation or something.

Hmm. Personally, I’d only want to filter specific, well-known, cache folders rather than anything with “cache” in the name…

I’m searching my Windows user profile right now and there’s quite a lot of folders with “cache” at the top-most branch and I’d be very wary of excluding quite a few of them - Battlenet, discord, Steam, Atom, TS3Client, OneNote, Origin, Winamp - absolutely tonnes of stuff.

If it’s in %AppData%\Local, maybe not so important. Some of it’s in %AppData%\Roaming, though.

Isn’t .duplicacy already excluded by default?

Recently I realised that .duplicacy-web - if installed for ‘just me’ - is included in backups of my Windows user profile. However, because the chunk caches for each repository are actually in a folder structure such as C:\Users\<user>\.duplicacy-web\repositories\localhost\0\.duplicacy\cache, I believe those folders get excluded anyway by virtue of being in a .duplicacy sub-directory.