Unable to disable or clear cache/temp files
See original GitHub issueOS: Win7x64 NWJS: sdk0.13.3 and sdk0.14.0rc3
User data folder never empties or never clears, the result is a folder with navigation/usage history that keeps filling constantly during the app use.
In my case I moved the user data folder to the app root, but the problem also occurs if no custom path is set in package.json
...
"chromium-args": "--user-data-dir='temp/'",
...
While navigating YouTube, for this example, and watching videos the temp folder fills up with history and temporary files. Closing the app does not clear the data and using nw.App.clearCache()
makes no difference either.
The result is a user data folder that starts with around 12MB on first app run
and ends up with over 200MB after watching a few videos or navigation a few pages.
I first noticed this when I found this folder with over 500MB and since then I tried to solve this problem but I haven’t been able to disable cache (WebKit page-cache option appears to have been dropped in the official documentation) or find a way to clear it up when the app is closed or once a certain size is reached.
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (4 by maintainers)
Top GitHub Comments
I have been struggling with this situation since this issue was posted, a few solutions have been working but not consitently, for some reason the cache still grows on its own and doesn’t clear at all except by manually deleting the folder.
I think I now have managed to find out which file is causing problems and it is the
History
file (no extension) that is located inside theDefault
folder in your app cache directory. It is somehow increasing its size randomly and it never clears up by any methods suggested here or found elsewhere.I haven’t yet managed to reproduce the problem intentionally but I am still monitoring it with every step I take so that I can find the correlation.
Below are the methods I have already used to clear the cache folder programatically:
code APIs:
Currently using NWJS 0.17.0beta2 SDK on Win7x64
Finally figured what was causing the History file bloat. For some reason using a non-nwjs built ffmpeg.dll (with proprietary codecs enabled) was causing an instant creation of a History file with 7.37MB. Using NWJS own ffmpeg.dll (and community contributed versions) made this problem stop completely. With this conclusion I think it is time to close this issue since all the previous methods have been working correctly so far.
EDIT: Seems like my previous conclusion was premature, the problem still occurs with other ffmpeg.dll modules. Since this is unrelated to this issue I will instead open a dedicated one.