LibHTTP+RequestServer: Move the HTTP cache implementation to LibHTTP

We currently have two ongoing implementations of RFC 9111, HTTP caching.
In order to consolidate these, this patch moves the implementation from
RequestServer to LibHTTP for re-use within LibWeb.
This commit is contained in:
Timothy Flynn 2025-11-28 10:04:59 -05:00 committed by Tim Flynn
parent 1f8a42c367
commit 21bbbacd07
Notes: github-actions[bot] 2025-11-29 13:36:06 +00:00
18 changed files with 240 additions and 203 deletions

View file

@ -10,11 +10,11 @@
#include <LibCore/Proxy.h>
#include <LibCore/Socket.h>
#include <LibCore/StandardPaths.h>
#include <LibHTTP/Cache/DiskCache.h>
#include <LibRequests/WebSocket.h>
#include <LibWebSocket/ConnectionInfo.h>
#include <LibWebSocket/Message.h>
#include <RequestServer/CURL.h>
#include <RequestServer/Cache/DiskCache.h>
#include <RequestServer/ConnectionFromClient.h>
#include <RequestServer/Request.h>
#include <RequestServer/Resolver.h>
@ -25,7 +25,7 @@ namespace RequestServer {
static HashMap<int, RefPtr<ConnectionFromClient>> s_connections;
static IDAllocator s_client_ids;
Optional<DiskCache> g_disk_cache;
Optional<HTTP::DiskCache> g_disk_cache;
ConnectionFromClient::ConnectionFromClient(NonnullOwnPtr<IPC::Transport> transport)
: IPC::ConnectionFromClient<RequestClientEndpoint, RequestServerEndpoint>(*this, move(transport), s_client_ids.allocate())