LibWeb+WebContent: Hook Fetch's HTTP cache into the clear-cache action

And fix a typo in an invocation to clear the cache.
This commit is contained in:
Timothy Flynn 2025-11-05 09:18:16 -05:00 committed by Andreas Kling
parent ac246caa0c
commit e0a8eb3767
Notes: github-actions[bot] 2025-11-05 17:28:33 +00:00
4 changed files with 14 additions and 2 deletions

View file

@ -1669,6 +1669,11 @@ public:
return s_cache;
}
void clear_cache()
{
m_cache.clear();
}
private:
HashMap<Infrastructure::NetworkPartitionKey, NonnullRefPtr<CachePartition>> m_cache;
};
@ -2849,4 +2854,9 @@ void set_http_cache_enabled(bool const enabled)
g_http_cache_enabled = enabled;
}
void clear_http_cache()
{
HTTPCache::the().clear_cache();
}
}

View file

@ -56,5 +56,6 @@ void set_sec_fetch_user_header(Infrastructure::Request&);
void append_fetch_metadata_headers_for_request(Infrastructure::Request&);
WEB_API void set_http_cache_enabled(bool enabled);
WEB_API void clear_http_cache();
}