You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cache directory on windows should be %localappdata% by default #1404
LOCALAPPDATA is the temporary files of Applications. Its uses include storing of desktop themes, Windows error reporting, caching and profiles of web browsers.
So cache path should be set to %LOCALAPPDATA% and HTTP Cache, GPUCache, Local Storage, Cookies, ... should be moved to this dir.
It is important to do this because %APPDATA% is meant to be synchronised accross computer/devices unlike %LOCALAPPDATA%
Reacted by Ryan Jackson, Kevin, Nikolay Seleznev, IhorKobylinskiy, Alexey Murz Korepov, Sebastian Danielsson, Tim Vilgot Mikael Fredenberg, Ashley and Marius
But%LOCALAPPDATA% have been introduced in windows 7. Previous version of windows does not have this environnement variables set nor the corresponding path. %APPDATA% is a fallback path on Vista and XP.
I'm not particularly excited about this change, I think we should close it. This is causing a problem for exactly zero users right now, but moving it has the potential to break everyone currently using Atom Shell who don't write a carefully coded migration routine, and end up breaking users. Zero benefit, non-zero downside == wontfix
@paulcbetts I understand your point, and I agree that this is a big concern.
The cleaner way to fix this would be to creates new API methods and deprecates old ones which allow the change without breaking old usage
If it is not worth considering, adding a notice on the documentation page would be fine
Chromium doesn't actually make use of the cache dir for browser's cache data, all cookies and caches are stored under appData dir. So making cache dir default to %LOCALAPPDATA% affects nothing unless user explicitly relies on the location of cache dir, but it also means it won't do what you wanted, e.g. move browser cache files to %LOCALAPPDATA%.
This is causing a problem for exactly zero users right now
The atom folder is getting bigger and bigger and in our company "Roaming" is synced on every windows login/logoff. When using plugins you get tens of thousand node_module files that slow down the syncing process.
After a closer looking, I found that Chromium doesn't respect the cache directory at all in most places, for things like browser caches and GPU caches the path is hard-coded under userData and there is no way to change that. So I'm going to remove the cache path since it is useless and causes many confusions.
After a closer looking, I found that Chromium doesn't respect the cache directory at all in most places, for things like browser caches and GPU caches the path is hard-coded under userData and there is no way to change that. So I'm going to remove the cache path since it is useless and causes many confusions.
This appears to still be the case in more recent Electron versions.
Because I've tried to use app.setPath('cache', newLocation) in Electron 5.0.6 (on Windows) and it doesn't work as intended. The app still uses the userData path.
Ran into this today. For a desktop app that might have local file system dependencies outside of the app data folders it makes more sense for %LOCALAPPDATA% to be the default if it's available as its basically safer. For example, my app lets a user create a project that references a local folder as a resource folder. I want to store the project file in the local app data folder to eliminate dealing with searching for project files across the system. It doesn't make sense for this project file to go to other machines in this case because the referenced directory belongs to the local system.
Could we reopen this issue because this has a monumental impact on corporate backup sizes : for each user of roaming profiles on Virtual Desktops / Virtual Apps, VDI or similar technologies, those caches are backed up with the rest of the profiles because there is no way of excluding them at the source or put them someplace else.
With a hundred users, a simple retention policy of keeping just 1 week of profiles, backed up once a day, eats a terabyte of useless data, for one simple app such as slack.
The amount of storage space (think about the CO2 is you're sensible to that) wasted for such a simple thing as "put cache in Windows cache designated location, put user data where it belongs" is a bit boggling.
Reacted by Marius, IhorKobylinskiy and Alexey Murz Korepov
It was the purpose of this MR (Customize Electron/Chromium cache location #18309) to make the difference between cache location and user data location.
It was my assumption, but it has been confirmed as duplicate so I expect to be able to redirect the location of the cache in the next version of Electron Else I will have to adapt/redo my MR over this new version.
I'm reopening this as it does seem like a reasonable request, but with the caveat that since we inherit this behavior from Chromium, it is not likely to be straightforward to change. It may come to pass that Chromium refactors in a way that makes it easier for us to make this sort of tweak possible, but without that or other in-depth work such as #19693, this may not be possible for a while.
Hey everyone! Thank you all so much for giving Electron a try and thinking about ways to make it better. As you can probably tell from how this issue has been open for ten years, so far it has never been important enough for someone to close it directly or to otherwise make the resources available for it to happen.
If you're reading this and are thinking to yourself "Alright, I'll do it!" - good for you! For smaller changes, you can usually open a well-tested and documented PR directly on this repository. For larger changes, I'd recommend that you start with a "request for comments". This will ensure that you don't spend a lot of time on a larger change without getting feedback about your approach first. Alternatively, you could always hire a consultant, either from the maintainer community our outside, to perform the work that's important to you.
In short, I'm closing this issue because we're currently not planning this work, but if you care deeply about this issue, we'd welcome your contribution.
Reacted by Alexey Murz Korepov, Sebastian Danielsson, Marius, beyondkmp, Coleman McFarland, Harsh Gupta and zXNoRegertzzXz
Activity
anaisbetts commentedon Apr 12, 2015
Cookies and local storage should roam across users
felicienfrancois commentedon Apr 13, 2015
@paulcbetts you may be right, that's sounds the most logical thing to do.
But Chrome store all Browser data in LOCALAPPDATA. I don't know why.
Maybe a compatibility purpose or because they want to handle roam on their own.
Well in anycase, this issue is still valid for cache data (http cache and GPUCache)
zcbenz commentedon Apr 15, 2015
Using
%LOCALAPPDATA%for cache dir sounds good to me, but Chrome would still store cache in%APPDATA%as far as I know.felicienfrancois commentedon Apr 15, 2015
@zcbenz on windows Google Chrome store cache AND user data in
%LOCALAPPDATA%And more precisely in
%LOCALAPPDATA%\Google\Chrome\User Data.Google chrome does not use
%APPDATA%.https://productforums.google.com/forum/#!topic/chrome/keN3Njx6gtM
But
%LOCALAPPDATA%have been introduced in windows 7. Previous version of windows does not have this environnement variables set nor the corresponding path. %APPDATA% is a fallback path on Vista and XP.So cache path should be set to
jorangreef commentedon Apr 15, 2015
Dropbox recently updated their app to prefer LOCALAPPDATA over APPDATA (which roams).
Often the app data is too large to roam, i.e. it's not just cookies.
anaisbetts commentedon Apr 15, 2015
Atom Shell doesn't run on XP or Vista anyways, we don't have to worry about that
anaisbetts commentedon Apr 15, 2015
I'm not particularly excited about this change, I think we should close it. This is causing a problem for exactly zero users right now, but moving it has the potential to break everyone currently using Atom Shell who don't write a carefully coded migration routine, and end up breaking users. Zero benefit, non-zero downside == wontfix
felicienfrancois commentedon Apr 15, 2015
@paulcbetts I understand your point, and I agree that this is a big concern.
The cleaner way to fix this would be to creates new API methods and deprecates old ones which allow the change without breaking old usage
If it is not worth considering, adding a notice on the documentation page would be fine
zcbenz commentedon Apr 16, 2015
Chromium doesn't actually make use of the
cachedir for browser's cache data, all cookies and caches are stored underappDatadir. So makingcachedir default to%LOCALAPPDATA%affects nothing unless user explicitly relies on the location ofcachedir, but it also means it won't do what you wanted, e.g. move browser cache files to%LOCALAPPDATA%.felicienfrancois commentedon Apr 16, 2015
@zcbenz from my tests and from chromium documentation, Chromium uses the same paths than Chrome except it replaces
Google/ChromebyChromium: All in%LOCALAPPDATA%, nothing in%APPDATA%https://www.chromium.org/user-experience/user-data-directory
Reminder:
%LOCALAPPDATA%=>HOME/Appdata/Local/%APPDATA%=>HOME/Appdata/Roaming/bux commentedon Oct 1, 2015
The atom folder is getting bigger and bigger and in our company "Roaming" is synced on every windows login/logoff. When using plugins you get tens of thousand node_module files that slow down the syncing process.
anaisbetts commentedon Oct 1, 2015
@bux578 The ~/.atom folder or node_modules isn't stored in AppData, you should file an issue about this in Atom
zcbenz commentedon Oct 4, 2015
After a closer looking, I found that Chromium doesn't respect the
cachedirectory at all in most places, for things like browser caches and GPU caches the path is hard-coded underuserDataand there is no way to change that. So I'm going to remove thecachepath since it is useless and causes many confusions.26 remaining items
sommereder commentedon Oct 25, 2016
But only Roaming gets synced here. Although I'm not sure how other companies handle that.
kof commentedon Apr 26, 2017
Why is this issue closed? this has been merged to develop branch, not to master…
aabuhijleh commentedon Nov 5, 2019
This appears to still be the case in more recent Electron versions.
Because I've tried to use
app.setPath('cache', newLocation)in Electron 5.0.6 (on Windows) and it doesn't work as intended. The app still uses theuserDatapath.kalbert312 commentedon Mar 7, 2020
Ran into this today. For a desktop app that might have local file system dependencies outside of the app data folders it makes more sense for
%LOCALAPPDATA%to be the default if it's available as its basically safer. For example, my app lets a user create a project that references a local folder as a resource folder. I want to store the project file in the local app data folder to eliminate dealing with searching for project files across the system. It doesn't make sense for this project file to go to other machines in this case because the referenced directory belongs to the local system.emmkimme commentedon Jun 24, 2021
My MR (Customize Electron/Chromium cache location #18309) has been closed. does it mean, I'm able to redirect the cache to any location now ?
pushkin- commentedon Jun 24, 2021
@emmkimme It was closed as dupe of this
imakiro commentedon Jun 29, 2021
Could we reopen this issue because this has a monumental impact on corporate backup sizes : for each user of roaming profiles on Virtual Desktops / Virtual Apps, VDI or similar technologies, those caches are backed up with the rest of the profiles because there is no way of excluding them at the source or put them someplace else.
With a hundred users, a simple retention policy of keeping just 1 week of profiles, backed up once a day, eats a terabyte of useless data, for one simple app such as slack.
The amount of storage space (think about the CO2 is you're sensible to that) wasted for such a simple thing as "put cache in Windows cache designated location, put user data where it belongs" is a bit boggling.
emmkimme commentedon Jun 29, 2021
It was the purpose of this MR (Customize Electron/Chromium cache location #18309) to make the difference between cache location and user data location.
imakiro commentedon Jun 29, 2021
The MR #18309 you pointed to is indicated as duplicate of this one, is there some miscommunication somewhere?
emmkimme commentedon Jun 29, 2021
It was my assumption, but it has been confirmed as duplicate so I expect to be able to redirect the location of the cache in the next version of Electron Else I will have to adapt/redo my MR over this new version.
nornagon commentedon Jun 29, 2021
I'm reopening this as it does seem like a reasonable request, but with the caveat that since we inherit this behavior from Chromium, it is not likely to be straightforward to change. It may come to pass that Chromium refactors in a way that makes it easier for us to make this sort of tweak possible, but without that or other in-depth work such as #19693, this may not be possible for a while.
felixrieseberg commentedon Jan 17, 2025
Hey everyone! Thank you all so much for giving Electron a try and thinking about ways to make it better. As you can probably tell from how this issue has been open for ten years, so far it has never been important enough for someone to close it directly or to otherwise make the resources available for it to happen.
If you're wondering what you can do to get this into Electron, great news - Electron is truly open source! We, the maintainers, welcome outside contributions - especially from individuals and companies interested in joining us in maintaining this platform.
If you're reading this and are thinking to yourself "Alright, I'll do it!" - good for you! For smaller changes, you can usually open a well-tested and documented PR directly on this repository. For larger changes, I'd recommend that you start with a "request for comments". This will ensure that you don't spend a lot of time on a larger change without getting feedback about your approach first. Alternatively, you could always hire a consultant, either from the maintainer community our outside, to perform the work that's important to you.
In short, I'm closing this issue because we're currently not planning this work, but if you care deeply about this issue, we'd welcome your contribution.