Skip to content

Commit 69e43fa

Browse files
添加 CacheControl 让PNG图片在浏览器保留7天
1 parent 9265906 commit 69e43fa

File tree

2 files changed

+2
-1
lines changed
  • src/main/kotlin/icu/takeneko/appwebterminal/support/http/plugins

2 files changed

+2
-1
lines changed

frontend

src/main/kotlin/icu/takeneko/appwebterminal/support/http/plugins/HTTP.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ fun Application.configureHTTP() {
2525
options { call, outgoingContent ->
2626
when (outgoingContent.contentType?.withoutParameters()) {
2727
ContentType.Text.CSS -> CachingOptions(CacheControl.MaxAge(maxAgeSeconds = 24 * 60 * 60))
28+
ContentType.Image.PNG -> CachingOptions(CacheControl.MaxAge(maxAgeSeconds = 7 * 24 * 60 * 60))
2829
else -> null
2930
}
3031
}

0 commit comments

Comments
 (0)