Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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 | ✅ |