Unable to clear cache #80

Closed
opened 2026-01-29 16:30:07 +00:00 by claunia · 2 comments
Owner

Originally created by @yoDon on GitHub (Nov 24, 2017).

Originally assigned to: @GregorBiswanger on GitHub.

I'm unable to find the Electron.NET version of the clearCache method that should be exposed on the session object, in large part because I'm not able to find an Electron.NET implementation of the session object. My guess is this is mostly a "we need more hands manually exposing Electron methods in Electron.NET" sort of issue which I'm happy to help with but I'm not sure what to do about starting to stub in the missing session object.

For context, see
https://stackoverflow.com/questions/31446782/how-to-clear-the-cache-data-in-electronatom-shell
and
70643a865b/docs/api/session.md

It looks to me like the clearCache method is added to the Javascript by way of the C++ WebFrame::BuildPrototype method in c18afc924b/atom/renderer/api/atom_api_web_frame.cc

For now, I'm manually clearing the on disk cache, which I found via https://stackoverflow.com/a/44675132/2827071

Originally created by @yoDon on GitHub (Nov 24, 2017). Originally assigned to: @GregorBiswanger on GitHub. I'm unable to find the Electron.NET version of the clearCache method that should be exposed on the session object, in large part because I'm not able to find an Electron.NET implementation of the session object. My guess is this is mostly a "we need more hands manually exposing Electron methods in Electron.NET" sort of issue which I'm happy to help with but I'm not sure what to do about starting to stub in the missing session object. For context, see https://stackoverflow.com/questions/31446782/how-to-clear-the-cache-data-in-electronatom-shell and https://github.com/electron/electron/blob/70643a865be97a76b4604619921f5e4d047e41b5/docs/api/session.md It looks to me like the clearCache method is added to the Javascript by way of the C++ WebFrame::BuildPrototype method in https://github.com/electron/electron/blob/c18afc924b7218555e529c0583773f58e1015cbe/atom/renderer/api/atom_api_web_frame.cc For now, I'm manually clearing the on disk cache, which I found via https://stackoverflow.com/a/44675132/2827071
claunia added the Feature label 2026-01-29 16:30:07 +00:00
Author
Owner

@GregorBiswanger commented on GitHub (May 16, 2019):

Fixed! Implemented for the next big Electron.NET version:

await browserWindow.WebContents.Session.ClearCacheAsync();

@GregorBiswanger commented on GitHub (May 16, 2019): Fixed! Implemented for the next big Electron.NET version: `await browserWindow.WebContents.Session.ClearCacheAsync();`
Author
Owner

@win32nipuh commented on GitHub (May 21, 2019):

ok, great, when you are going to release this big version?

@win32nipuh commented on GitHub (May 21, 2019): ok, great, when you are going to release this big version?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#80