Package io.ktor.server.plugins

Types

Link copied to clipboard
class ConditionalHeaders

A plugin that avoids sending the body of content if it has not changed since the last request.

Functions

Link copied to clipboard
fun Headers.parseVersions(): List<Version>

Retrieves LastModified and ETag versions from headers.

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

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

Properties

Link copied to clipboard
val OutgoingContent.defaultVersions: List<Version>

Retrieves LastModified and ETag versions from this OutgoingContent headers