Electron 27: Should session cache auto‑clear on startup be enabled by default?
0 reputation · 11 Mar 2025, 20:14 UTC
Electron 27: Session Cache Auto‑Clear
The default session cache persists across app restarts, meaning resources fetched once remain cached until explicitly cleared via session.defaultSession.clearCache(). This behavior can lead to stale data being served after updates or when resources change on the server.
There is currently no configuration flag to enable automatic cache clearing on startup, leaving the decision to developers or to future Electron releases. Adding such a flag could improve freshness but may degrade startup performance and interfere with offline mode or pre‑loaded assets.
Given the trade‑offs, the community is uncertain whether Electron should ship a new flag or rely on manual clearing. We need to clarify the direction and best practices.
- Will Electron 27 introduce a configuration option to automatically clear the session cache on each app launch?
- What are the performance and offline‑support implications of enabling automatic cache clearing by default?
- How can developers balance the need for fresh resources with the requirement to support offline functionality without relying on manual cache management?