mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-04 11:24:35 -05:00
Add Cache-Control to Extension Icons (#765)
This commit is contained in:
@@ -16,6 +16,7 @@ import suwayomi.tachidesk.server.JavalinSetup.future
|
|||||||
import suwayomi.tachidesk.server.util.handler
|
import suwayomi.tachidesk.server.util.handler
|
||||||
import suwayomi.tachidesk.server.util.pathParam
|
import suwayomi.tachidesk.server.util.pathParam
|
||||||
import suwayomi.tachidesk.server.util.withOperation
|
import suwayomi.tachidesk.server.util.withOperation
|
||||||
|
import kotlin.time.Duration.Companion.days
|
||||||
|
|
||||||
object ExtensionController {
|
object ExtensionController {
|
||||||
private val logger = KotlinLogging.logger {}
|
private val logger = KotlinLogging.logger {}
|
||||||
@@ -157,6 +158,8 @@ object ExtensionController {
|
|||||||
future { Extension.getExtensionIcon(apkName) }
|
future { Extension.getExtensionIcon(apkName) }
|
||||||
.thenApply {
|
.thenApply {
|
||||||
ctx.header("content-type", it.second)
|
ctx.header("content-type", it.second)
|
||||||
|
val httpCacheSeconds = 365.days.inWholeSeconds
|
||||||
|
ctx.header("cache-control", "max-age=$httpCacheSeconds, immutable")
|
||||||
it.first
|
it.first
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user