Package io.ktor.server.plugins.conditionalheaders

Types

Link copied to clipboard
class ConditionalHeadersConfig

A configuration for the ConditionalHeaders plugin.

Functions

Link copied to clipboard
fun <ERROR CLASS>.parseVersions(): List<<ERROR CLASS>>

Retrieves the LastModified and ETag versions from headers.

Link copied to clipboard
suspend fun <ERROR CLASS>.versionsFor(content: <ERROR CLASS>): List<<ERROR CLASS>>

Retrieves versions such as LastModifiedVersion or EntityTagVersion for a given content.

Link copied to clipboard
suspend fun <ERROR CLASS>.withETag(etag: String, putHeader: Boolean = true, block: suspend () -> Unit)

Checks the current etag value and pass it through conditions supplied by the remote client. Depending on the conditions, it produces 410 Precondition Failed or 304 Not modified responses when necessary. Otherwise, sets the ETag header and delegates to the block function

Properties

Link copied to clipboard
val ConditionalHeaders: <ERROR CLASS><ConditionalHeadersConfig>

A plugin that avoids sending the body of content if it has not changed since the last request. This is achieved by using the following headers:

Link copied to clipboard
val <ERROR CLASS>.defaultVersions: List<<ERROR CLASS>>

Retrieves the LastModified and ETag versions from this OutgoingContent headers.