class DiskHttpCache
source · line 13public class DiskHttpCache private constructor(
/**
* The cache entry directory.
*/
public val directory: Path,
/**
* Maximum total accounted storage bytes.
*/
public val maxBytes: Long,
/**
* Maximum body bytes accepted for one entry.
*/
public val maxEntryBytes: Long,
/**
* Maximum committed entry count.
*/
public val maxEntries: Long,
/**
* Maximum metadata bytes accepted for an entry.
*/
public val maxMetadataBytes: Long,
/**
* Whether completed entry data is synchronized before publication.
*/
public val syncOnCommit: Boolean
) : HttpCache
- Supertype
HttpCache
A bounded disk cache with atomic entry publication and owned read snapshots. Open it on the active event loop; pending writes do not appear as completed entries.
property maxEntryBytes
source · line 25public val maxEntryBytes: Long
get: public read-only
Maximum body bytes accepted for one entry.
function lookup
source · line 93public 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 93request: HttpCacheRequest
property directory
source · line 17public val directory: Path
get: public read-only
The cache entry directory.
property maxBytes
source · line 21public val maxBytes: Long
get: public read-only
Maximum total accounted storage bytes.
property syncOnCommit
source · line 37public val syncOnCommit: Boolean
get: public read-only
Whether completed entry data is synchronized before publication.
property sizeBytes
source · line 50public val sizeBytes: Long
get: public read-only
Current accounted committed storage bytes.
getter get
source · line 50get(): Long
property maxMetadataBytes
source · line 33public val maxMetadataBytes: Long
get: public read-only
Maximum metadata bytes accepted for an entry.
property maxEntries
source · line 29public val maxEntries: Long
get: public read-only
Maximum committed entry count.
property entryCount
source · line 54public val entryCount: Long
get: public read-only
Current committed entry count.
getter get
source · line 54get(): Long
function clear
source · line 149public suspend fun clear(): Unit
Invalidates all entries and prevents existing tentative writes from publishing.
function begin
source · line 118public 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 118record: HttpCacheRecord
function invalidate
source · line 130public 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 url
source · line 130url: String
parameter partition
source · line 130partition: String