ETagProvider

fun interface ETagProvider(source)

Built‑in strategies for generating io.ktor.http.HttpHeaders.ETag for static content.

Note: for this functionality to work, you need to install the ConditionalHeaders plugin.

Usage:

install(ConditionalHeaders)

routing {
staticFiles("/assets", File("assets")) {
etag(ETagProvider.StrongSha256)
}
}

Report a problem

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun provide(resource: Any): EntityTagVersion?

Provides an EntityTagVersion for the given resource or null if it cannot be provided.