| Summary: | [Browser] Xulrunner on Windows leaves cache files in Roaming Profile | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Martin Oberhuber <mober.at+eclipse> |
| Component: | SWT | Assignee: | Grant Gayed <grant_gayed> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | eclipse.felipe, etyme1000, ganoro, jacek.pospychala, markward.schubert, norbert.schoepke, parvez12, ramgopalmit |
| Version: | 3.7.1 | ||
| Target Milestone: | 3.8 M7 | ||
| Hardware: | PC | ||
| OS: | Windows All | ||
| Whiteboard: | |||
|
Description
Martin Oberhuber
FWIW, I happened to debug into the Mozilla class today for a different reason, and it looked like Mozilla#initPreferences() might be a place where Eclipse/SWT could specify a custom location for the cache by setting a browser.cache.disk.parent preference: http://kb.mozillazine.org/Browser.cache.disk.parent_directory I'm not going to have time to dig into this any deeper, but maybe somebody else can follow up from here... see code at http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/bundles/org.eclipse.swt/Eclipse%20SWT%20Mozilla/common/org/eclipse/swt/browser/Mozilla.java There's a much older bug about this, marked as an enhancement. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=178918. If you don't need the cache or the cache size makes it prohibitive to use, one possible workaround is to disable it. The pref is "browser.cache.disk.enable".
The XULRunner distribution contains a file \greprefs\all.js where the cache is enabled by default. Disable it by changing the line to:
pref("browser.cache.disk.enable", false);
The \Mozilla\eclipse folder will still be created in the user's AppData\Roaming directory, but no "Cache" folder will be created when you restart your Eclipse application.
Note that I first tried to set the same preference in the file
\defaults\pref\xulrunner.js but this did not work. Apparently the above file takes precedence, at least in embedded scenarios like running inside the Eclipse SWT Mozilla control.
Regards
Norbert
(In reply to comment #3) > The XULRunner distribution contains a file \greprefs\all.js -- set > pref("browser.cache.disk.enable", false); the workaround works - so many thanks for that ! SWT team, is there a case for setting this globally in the SWT Java / Javascript / config bits ? Given that the Eclipse config area for Xulrunner may be shared by multiple instances of Eclipse running at the same time it would seem wise to me to disable disk caching by default... I've had a quick look, I think that Firefox's approach (profile can roam, cache always local) makes sense. The Browser control should be able to do this, will revisit next week. Fixed on Windows > 20120325, patch: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=925a13ca36585501cfd4633effa1686ff264daa0 . Keeping report open to investigate whether something similar should be done on Linux and Mac. On Linux, Firefox stores its cache with the user profile, so no change made here. Fixed on OS X > 20120326, patch: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=baad710d04c31f3112d887cdf1d74d0dac488555 . (In reply to comment #7) > On Linux, Firefox stores its cache with the user profile, so no change made > here. > > Fixed on OS X > 20120326, patch: > http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/ solution is delete files from C:\Users\DE3\AppData\Roaming\Mozilla\eclipse\Cache I faced problem while clearing mozila cache |