Skip to content

feat: add MQTT cache-clear button - #217

Open
TMA84 wants to merge 7 commits into
leukipp:mainfrom
TMA84:main
Open

feat: add MQTT cache-clear button#217
TMA84 wants to merge 7 commits into
leukipp:mainfrom
TMA84:main

Conversation

@TMA84

@TMA84 TMA84 commented Jun 22, 2026

Copy link
Copy Markdown

Summary

  • Adds a Clear Cache button entity in Home Assistant that clears the HTTP cache and Service Worker CacheStorage, then reloads the webview
  • This allows remotely recovering from bloated SW caches without physical access to the device

Changes

  • js/integration.js: initCacheClear() registers a new MQTT button entity (mdi:cached) under the <node>/cache/clear topic
  • js/webview.js: clearCacheView() clears cachestorage and serviceworkers via Electron's session.clearStorageData() API before reloading the webview

Motivation

Service Worker CacheStorage can grow to several GB on long-running kiosk displays (observed: 5.9 GB). While the root cause can be fixed on the app side by versioning cache names, having a remote cache-clear button provides a practical recovery mechanism without needing physical access to the device.

Test plan

  • MQTT button entity appears in Home Assistant after restart
  • Pressing the button clears SW CacheStorage and reloads the webview
  • Display turns on before cache clear if it was off

🤖 Generated with Claude Code

TMA84 and others added 7 commits February 19, 2026 20:24
Adds a 'Clear Cache' button entity in Home Assistant that clears the
HTTP cache and Service Worker CacheStorage, then reloads the webview.
This allows remotely recovering from bloated SW caches without
physical access to the device.

- integration.js: initCacheClear() registers the MQTT button
- webview.js: clearCacheView() clears cachestorage + serviceworkers via
  Electron session API before reloading

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@leukipp

leukipp commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Can you confirm that the cache-clear button decreases RAM usage immediately?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants