Is there a non-cursed way to use a compiled Kotlin...
# compose-web
l
Is there a non-cursed way to use a compiled Kotlin/Wasm website with Ktor on Kotlin/JVM? That is, have a Compose Web website on a Kotlin/JVM server. For context, the cursed way is just copying the compiled Kotlin/Wasm to the server's resources directory in a Gradle task.
a
How is that cursed? 😅
l
Cause then I need to manage caching of said resources myself... It just feels like something that should be handled by the Kotlin/multiplatform plugin itself.
a
You mean browser caching?
l
I mean not loading the page from the disk every time.
a
Loading at what moment? When you move it to resources of the server?
l
@Arjan van Wieringen I mean, when a browser asks for a webpage, theoretically, it should be cached, not loaded from disk.
a
Yeah, so you should solve that with proper cache control from the server and the browser will follow these rules. I fail to see how http cache control headers should be a responsibility of the Kotlin Multiplatform plug-in? It is very easy to do with Ktor
1
l
I meant, literally cache the file in memory.
But yeah I get your point
a
Same, just load it in and cache it in your server code. Why is this a responsibility of the multiplatform plugin?
l
It ain't.
a
So why ask it?
l
To make sure.
a
Ah clear
Caching static files in memory is a micro optimization you’d probably not need unless you’re serving millions
🙏 1