mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
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.
35 lines
718 B
C++
35 lines
718 B
C++
/*
|
|
* Copyright (c) 2025, Tim Flynn <trflynn89@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Badge.h>
|
|
#include <AK/Optional.h>
|
|
#include <AK/Weakable.h>
|
|
#include <LibHTTP/Forward.h>
|
|
|
|
namespace HTTP {
|
|
|
|
class CacheRequest : public Weakable<CacheRequest> {
|
|
public:
|
|
virtual ~CacheRequest() = default;
|
|
|
|
virtual void notify_request_unblocked(Badge<DiskCache>) = 0;
|
|
|
|
protected:
|
|
enum class CacheStatus : u8 {
|
|
Unknown,
|
|
NotCached,
|
|
WrittenToCache,
|
|
ReadFromCache,
|
|
};
|
|
|
|
Optional<CacheEntryReader&> m_cache_entry_reader;
|
|
Optional<CacheEntryWriter&> m_cache_entry_writer;
|
|
CacheStatus m_cache_status { CacheStatus::Unknown };
|
|
};
|
|
|
|
}
|