
Enhances static file management by automatically revisioning files with content-based hashes for optimal caching, eliminating the need to rename local files.
A Ktor server plugin made for automatically revisioning static files.
A revisioned file will include a short hash of its content in the file name. This enables optimal caching without you ever having to change the name of the local file.
This library is available on Maven Central.
implementation("io.github.janmalch:ktor-revfile-core:0.2.0")
implementation("io.github.janmalch:ktor-revfile-html:0.2.0") // add for kotlinx.html interoppackage com.example
object AppAssets : RevFileRegistry("/assets/") {
val main = resource("main.js")
val styles = resource("styles.css")
}
fun Application.module() {
install(RevFilePlugin) {
+AppAssets
}
}Checkout the complete documentation for usage details.
A Ktor server plugin made for automatically revisioning static files.
A revisioned file will include a short hash of its content in the file name. This enables optimal caching without you ever having to change the name of the local file.
This library is available on Maven Central.
implementation("io.github.janmalch:ktor-revfile-core:0.2.0")
implementation("io.github.janmalch:ktor-revfile-html:0.2.0") // add for kotlinx.html interoppackage com.example
object AppAssets : RevFileRegistry("/assets/") {
val main = resource("main.js")
val styles = resource("styles.css")
}
fun Application.module() {
install(RevFilePlugin) {
+AppAssets
}
}Checkout the complete documentation for usage details.