Skip to content

frankois944/KtorKMPFileCaching

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f6b6a62 · Feb 10, 2025

History

66 Commits
Feb 10, 2025
Jan 15, 2025
Feb 10, 2025
Feb 10, 2025
Jan 15, 2025
Jun 21, 2024
Jun 21, 2024
Feb 10, 2025
Dec 23, 2024
Feb 2, 2025
Jun 21, 2024
Jun 21, 2024
Jan 16, 2025

Repository files navigation

Ktor KMP File Caching

Tests Maven Central Version

This project is a Ktor client caching, which is (almost) literally a port of FileStorage but for KMP based on OKIO and kotlinx serialization.

Important

The library uses the LocalStorage for the wasm target, there is a size limitation (about 5mo in total) who need to be manually managed by yourself.

Example

private val publicStorageCaching = KtorFileCaching()
HttpClient {
    install(HttpCache) {
        publicStorage(publicStorageCaching)
    }
}

Installation

Kotlin JS for browser

implementation("io.github.frankois944:ktorfilecaching-jsbrowser:0.6.0")

Kotlin JS for NodeJS

implementation("io.github.frankois944:ktorfilecaching-jsnode:0.6.0")

other platform

implementation("io.github.frankois944:ktorfilecaching:0.6.0")

Platforms

The current supported targets are :

Target Supported
jvm
js Node
js browser
wasmJS
iosX64
iosArm64
iosSimulatorArm64
macosX64
macosArm64
watchosArm32
watchosArm64
watchosSimulatorArm64
watchosX64
tvosSimulatorArm64
tvosX64
mingwX64
mingwX64
linuxX64
linuxArm64