Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/frankois944/ktorkmpfilecaching
Ktor File caching for KMP project
https://github.com/frankois944/ktorkmpfilecaching
Last synced: 15 days ago
JSON representation
Ktor File caching for KMP project
- Host: GitHub
- URL: https://github.com/frankois944/ktorkmpfilecaching
- Owner: frankois944
- License: apache-2.0
- Created: 2024-06-21T08:17:57.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-12-12T12:03:05.000Z (20 days ago)
- Last Synced: 2024-12-12T13:19:02.103Z (20 days ago)
- Language: Kotlin
- Size: 82 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ktor KMP File Caching
This project add a file caching for [Ktor client caching](https://ktor.io/docs/client-caching.html).
Currently, there is a Memory caching, it's the
default [HttpCache](https://ktor.io/docs/client-caching.html#memory_cache) behavior of the plugin and
a [file caching only for Java Target](https://ktor.io/docs/client-caching.html#persistent_cache).The main goal is to make available file caching to many KMP target as possible.
It's based on [OKIO dependency](https://square.github.io/okio/multiplatform/)
and [kotlinx serialization](https://github.com/Kotlin/kotlinx.serialization).## Example
```kotlin
private val publicStorageCaching = KtorFileCaching()
HttpClient {
install(HttpCache) {
publicStorage(publicStorageCaching)
}
}
```## Installation
### Kotlin JS for browser
```kotlin
implementation("io.github.frankois944:ktorfilecaching-jsbrowser:0.4.1")
```### Kotlin JS for NodeJS
```kotlin
implementation("io.github.frankois944:ktorfilecaching-jsnode:0.4.1")
```### other platform
```kotlin
implementation("io.github.frankois944:ktorfilecaching:0.4.1")
```## 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 | ✅ |