question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to disable or clear cache/temp files

See original GitHub issue

OS: 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 small

and ends up with over 200MB after watching a few videos or navigation a few pages. big

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:closed
  • Created 7 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Yonezptcommented, Aug 29, 2016

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 the Default 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:

"chromium-args": "--user-data-dir='temp/' --disk-cache-size=1 --media-cache-size=1 --incognito"

code APIs:

window.nw.App.clearCache();

// this one will cause significantly increase the
// shutdown duration if run during app exit
window.chrome.browsingData.remove({
    since: 0
}, {
    appcache: true,
    cache: true,
    cookies: true,
    downloads: true,
    fileSystems: true,
    formData: true,
    history: true,
    indexedDB: true,
    localStorage: true,
    pluginData: true,
    passwords: true,
    serverBoundCertificates: true,
    serviceWorkers: true,
    webSQL: true
});

Currently using NWJS 0.17.0beta2 SDK on Win7x64

0reactions
Yonezptcommented, Sep 3, 2016

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to delete the contents of the Temporary Internet Files folder
This article describes how to permanently remove the contents of the Temporary Internet Files folder from your computer. Watch a video about how...
Read more >
Cache / Temp folder - RealityCapture Support
Please note that keeping RealityCapture temporary files can be useful for ... Open the RealityCapture folder and delete its contents.
Read more >
Things to know before deleting temporary, cache and log files ...
Files under the configuration folder can be regenerated using the osgiCfgInit command. Why remove these files?: You cannot start the server due to...
Read more >
Delete cache/temp files for multiple user profiles? : r/PowerShell
You can't delete loaded profiles, and system files are very small. If the user has an internet cache, they are usually stored per-profile,...
Read more >
Unable to download the client cache files, Please check with ...
The Rich Client is logged in in skip client cache mode. I Stop all TC services and clear cache\temp folders Siemens, Teamcenter folder...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found