首页 > 解决方案 > Electron: How to store data in cache manually

问题描述

I'm seeing a lot of info about clearing the cache on electron app, but not about how to save the data in cache.


This is where the data is cached:
Linux: $XDG_CACHE_HOME or ~/.cache/electron/
MacOS: ~/Library/Caches/electron/
Windows: %LOCALAPPDATA%/electron/Cache or ~/AppData/Local/electron/Cache/

And there are binary files in this location.

Is there a way to save the file in this path?

标签: reactjsfileelectron

解决方案


如果您像我一样使用公司代理,并且希望按照https://www.electronjs.org/docs/v14-xy/tutorial/installation#custom-mirrors-and-caches中的说明手动创建缓存,只需使用私人的、不受限制的笔记本电脑在测试应用程序中安装 electron,然后将缓存文件夹复制到您的实际公司机器。自己手动做太麻烦了。


推荐阅读