Should I randomly delete files to keep at most, say, 1,000 around?
Should I just let the user take care of this, adding files without any limit?
Should I purge the whole directory every once in a while (if the user starts my program)?
I don't think I can make use of the file's creation/modification data, as I need this information to check if the thumbnail matches the original image's data.
@cameronotsuka Thanks, I'll look into that. Currently, my file names already include a 64 character hash, in addition to tiny rotation information. I might add another hash, and I fear that the file names get too long - but (ab)using the file name might be a valid approach!
@c_otto83 why not add a timestamp to the filename? I’d also say add the option to configure cache size on disk. If you use the XDG spec (I like the platformdirs library for selecting the correct directory), then people can also use other scripts/programs to fine-tune their cache management.