Releases: tiper/KtorRequestDeduplication
Releases · tiper/KtorRequestDeduplication
3.1.1
3.1.0
What's New
A correctness release. The plugin now plays nicely with libraries that cancel and restart coroutines on recomposition.
🐛 Bug Fixes
- Cancellation incorrectly propagated to non-cancelled waiters — if one coroutine cancelled, other still-active waiters could get hit with a
CancellationExceptionthey didn't ask for. They now correctly retry as a deduplicated group and get their response. - Premature entry removal — the first waiter to finish could remove the shared entry from the map while others were still using it.
- Cleanup skipped under cancellation —
mutex.withLockinsidefinallycould be interrupted byCancellationExceptionwhen the coroutine was already cancelled, leaving stale entries in the map.
✨ Improvements
minWindow— new config option that holds the response open for a minimum number of milliseconds, giving late-joining concurrent requests a chance to deduplicate against fast responses (errors, cache hits, etc.).install(RequestDeduplication) { minWindow = 50 // ms }
Full Changelog: 3.0.0...3.1.0
3.0.0
This release adds full Ktor 3.0.0+ support and expands Kotlin Multiplatform target coverage. The request deduplication behavior remains the same, now validated against Ktor 3.x.
Highlights
- Ktor 3.0.0+ support
- Expanded platform targets (including WebAssembly and Android Native)
- Aligned versioning: use plugin v3.x.x with Ktor 3.x
Supported Platforms (v3.x.x)
- ✅ JVM (Java 8+)
- ✅ Android (API 21+)
- ✅ Android Native (arm32, arm64, x86, x64)
- ✅ iOS (arm64, x64, simulatorArm64)
- ✅ tvOS (x64, arm64, simulatorArm64)
- ✅ watchOS (arm32, arm64, x64, simulatorArm64, deviceArm64)
- ✅ macOS (x64, arm64)
- ✅ Linux (x64, arm64)
- ✅ Windows (mingwX64)
- ✅ JavaScript (Browser, Node.js)
- ✅ WebAssembly (wasmJs - Browser, Node.js)
Compatibility
- Plugin v3.x.x → Ktor 3.0.0+
- Plugin v2.x.x → Ktor 2.3.0+
Installation
dependencies {
implementation("io.github.tiper:ktor-client-deduplication:3.x.x")
}Upgrade Guidance
- If you are on Ktor 2.x, stay on v2.x.x of this plugin.
- If you upgrade to Ktor 3.x, switch to v3.x.x.
2.0.0
🎉 First production-ready release of Ktor Client Request Deduplication
✨ Features
Deduplication
- Prevents duplicate concurrent HTTP requests
- Multiple identical requests → one actual HTTP call
- Configurable by HTTP method and headers
Performance
- O(1) deduplication check
- ~500ns overhead per request (0.0005% of network time)
- Smart memory sharing: 1MB × 10 callers = 1MB memory (not 10MB)
Safety
- Thread-safe (Mutex synchronization)
- Proper cancellation handling (SupervisorJob)
- Error response deduplication
- 29 comprehensive unit tests