RequestServer: Add a time parameter to the clear cache endpoint

This allows removing cache entries last accessed since a provided
timestamp.
This commit is contained in:
Timothy Flynn 2025-11-02 16:44:30 -05:00 committed by Tim Flynn
parent ba49942b6d
commit 3f61f0f189
Notes: github-actions[bot] 2025-11-12 14:08:53 +00:00
11 changed files with 35 additions and 38 deletions

View file

@ -312,10 +312,10 @@ void ConnectionFromClient::estimate_cache_size_accessed_since(u64 cache_size_est
async_estimated_cache_size(cache_size_estimation_id, sizes);
}
void ConnectionFromClient::clear_cache()
void ConnectionFromClient::remove_cache_entries_accessed_since(UnixDateTime since)
{
if (g_disk_cache.has_value())
g_disk_cache->clear_cache();
g_disk_cache->remove_entries_accessed_since(since);
}
void ConnectionFromClient::websocket_connect(i64 websocket_id, URL::URL url, ByteString origin, Vector<ByteString> protocols, Vector<ByteString> extensions, HTTP::HeaderMap additional_request_headers)