If you have a Samsung device, you should have an Auto optimization feature built in.
Please follow these steps to turn off this feature:
1. Go to Device Settings > Biometrics and security
2. Scroll down to the bottom of the screen and tap "Device care"
3. Tap on "Storage" and then tap on "Storage booster"
4. Switch off the "Audo delete unnecessary data" feature.
Disclaimer: Some Samsung devices, have "Device care" as a separate feature. From Device Settings, go to "Battery and Device care" and tap on the three dots at the top right corner of the screen. Tap on "Automation" and swtich it off the "Auto optimise daily" toggle switch.
If you are using a Google Pixel device, please follow these instructions:
- Go to Device Settings
- Tap on "Storage"
- Turn off the "Smart storage" feature
Also, if you have downloaded the "Files by Google" app or any similar cleaner app, it most likely targets and deletes the Offline Database every day as well. You can check the app's settings and switch them off accordingly.