I encountered a problem in frontend while updating the profile image of an user due to the way Flutter handles network images. It caches the images based on the URL. Since it stays the same in the current backend implementation, the image doesn't reload after an update. Manually deactivating the cache has some mean side-effects.
Therefore the easiest and best solution I found was to randomize the file name, so that the path to the image also changes. deleteFilesWithPrefix does the cleanup.
I encountered a problem in frontend while updating the profile image of an user due to the way Flutter handles network images. It caches the images based on the URL. Since it stays the same in the current backend implementation, the image doesn't reload after an update. Manually deactivating the cache has some mean side-effects.
Therefore the easiest and best solution I found was to randomize the file name, so that the path to the image also changes.
deleteFilesWithPrefix
does the cleanup.