class MemoryHttpCache
source · line 9public class MemoryHttpCache public constructor(
/**
* Maximum total accounted storage bytes.
*/
public val maxBytes: Long = 33554432L,
/**
* Maximum body bytes accepted for one entry.
*/
public val maxEntryBytes: Long = 8388608L,
/**
* Maximum committed entry count.
*/
public val maxEntries: Long = 1024L
) : HttpCache
- Supertype
HttpCache
A bounded in-memory cache with least-recently-used eviction. Entries become visible only after a successful commit.
function begin
source · line 60public override suspend fun begin(record: HttpCacheRecord): HttpCacheWriter?
- Overrides
begin· HttpCache
Starts a tentative body write or returns None when storage declines it; only commit publishes the entry.
parameter record
source · line 60record: HttpCacheRecord
function lookup
source · line 44public override suspend fun lookup(request: HttpCacheRequest): HttpCacheSnapshot?
- Overrides
lookup· HttpCache
Returns an owned matching representation snapshot, or None. The caller closes a returned snapshot.
parameter request
source · line 44request: HttpCacheRequest
property sizeBytes
source · line 34public val sizeBytes: Long
get: public read-only
Current accounted committed storage bytes.
getter get
source · line 34get(): Long
property maxEntryBytes
source · line 17public val maxEntryBytes: Long = 8388608L
get: public read-only
Maximum body bytes accepted for one entry.
property maxEntries
source · line 21public val maxEntries: Long = 1024L
get: public read-only
Maximum committed entry count.
function invalidate
source · line 72public override suspend fun invalidate(partition: String, url: String): Unit
- Overrides
invalidate· HttpCache
Invalidates all identities and Vary variants for the selected partition and URL.
parameter partition
source · line 72partition: String
parameter url
source · line 72url: String
constructor constructor
source · line 9constructor(public val maxBytes: Long = 33554432L, public val maxEntryBytes: Long = 8388608L, public val maxEntries: Long = 1024L)
parameter maxEntryBytes
source · line 17public val maxEntryBytes: Long = 8388608L
parameter maxEntries
source · line 21public val maxEntries: Long = 1024L
parameter maxBytes
source · line 13public val maxBytes: Long = 33554432L
function clear
source · line 88public fun clear(): Unit
Invalidates all entries and prevents existing tentative writes from publishing.
property maxBytes
source · line 13public val maxBytes: Long = 33554432L
get: public read-only
Maximum total accounted storage bytes.
property entryCount
source · line 38public val entryCount: Long
get: public read-only
Current committed entry count.
getter get
source · line 38get(): Long