LibWebView+RequestServer: Support clearing the HTTP disk cache

This is a bit of a blunt hammer, but this hooks an action to clear the
HTTP disk cache into the existing Clear Cache action. Upon invocation,
it stops all existing cache entries from making further progress, and
then deletes the entire cache index and all cache files.

In the future, we will of course want more fine-grained control over
cache deletion, e.g. via an about:history page.
This commit is contained in:
Timothy Flynn 2025-10-09 14:24:47 -04:00 committed by Andreas Kling
parent 42eaea1043
commit 163e8e5b44
Notes: github-actions[bot] 2025-10-14 11:41:38 +00:00
10 changed files with 84 additions and 10 deletions

View file

@ -824,7 +824,10 @@ void Application::initialize_actions()
m_debug_menu->add_separator();
m_debug_menu->add_action(Action::create("Collect Garbage"sv, ActionID::CollectGarbage, debug_request("collect-garbage"sv)));
m_debug_menu->add_action(Action::create("Clear Cache"sv, ActionID::ClearCache, debug_request("clear-cache"sv)));
m_debug_menu->add_action(Action::create("Clear Cache"sv, ActionID::ClearCache, [this, clear_memory_cache = debug_request("clear_cache")]() {
m_request_server_client->async_clear_cache();
clear_memory_cache();
}));
m_debug_menu->add_action(Action::create("Clear All Cookies"sv, ActionID::ClearCookies, [this]() { m_cookie_jar->clear_all_cookies(); }));
m_debug_menu->add_separator();