I am using the ImagePicker (https://pub.dev/packages/image_picker) plugin to record videos and I noticed the recorded videos are stored in app's cache folder (example: /data/user/0/com.example.app/cache/999b6a18-114b-4fd3-b089-09ce4574bf765726458033916036262.mp4")
In the plugin docs it says
Note: Images and videos picked using the camera are saved to your application's local cache, and should therefore be expected to only be around temporarily. If you require your picked image to be stored permanently, it is your responsibility to move it to a more permanent location.
Here's what I am wondering about:
Overall would you guys recommend that I delete the recorded cached video immediately after processing it (Example uploading it to my server)?
Usually, cached files remains in the folder until you uninstall the application or when you use a "Clear Cache" option (also works with "File Cleaner" applications). In the case of images fetched from a web API they might contains a Cache-Control header which will help to define directives to invalidate them from the cache.
Sometimes, a different behavior can occur on Android phones depending of the software overlay, for example Honor software (EMUI) is known for clearing cached files by itself from time to time, but it does not seem like the exact duration is mentioned anywhere.
The cache folder does not have a size limitation, it will grow as big as needed (or until your phone runs out of available space), this is why people tends to recommend clearing the cache of certain applications manually when it becomes too big.