useFileForCache

fun useFileForCache(block: (call: ApplicationCall) -> Boolean = { true })(source)

Specifies if a temp file should be used to cache a request body.

Works only if cacheRawRequest is true.

Can be called multiple times; if any of blocks returns true, the request body will be cached in file. Otherwise, it will be cached in memory.

With a file cache, every receive waits until the whole body is written to the file. With a memory cache, the first receive streams the body as it arrives.

Report a problem