use nginx proxy_cache for /manifest.json

pull/9764/head
Thibault Duplessis 2021-09-09 09:04:43 +02:00
parent 73cea770f7
commit efb9d5e8c1
1 changed files with 29 additions and 30 deletions

View File

@ -120,38 +120,37 @@ Allow: /
}
}
private lazy val manifestResponse = Ok(
Json.stringify(
Json.obj(
"name" -> env.net.domain.value,
"short_name" -> "Lichess",
"start_url" -> "/",
"display" -> "standalone",
"background_color" -> "#161512",
"theme_color" -> "#161512",
"description" -> "The (really) free, no-ads, open source chess server.",
"icons" -> List(32, 64, 128, 192, 256, 512, 1024).map { size =>
Json.obj(
"src" -> s"//${env.net.assetDomain.value}/assets/logo/lichess-favicon-$size.png",
"sizes" -> s"${size}x$size",
"type" -> "image/png"
)
},
"related_applications" -> Json.arr(
Json.obj(
"platform" -> "play",
"url" -> "https://play.google.com/store/apps/details?id=org.lichess.mobileapp"
),
Json.obj(
"platform" -> "itunes",
"url" -> "https://itunes.apple.com/us/app/lichess-free-online-chess/id968371784"
def manifest =
Action {
JsonOk {
Json.obj(
"name" -> env.net.domain.value,
"short_name" -> "Lichess",
"start_url" -> "/",
"display" -> "standalone",
"background_color" -> "#161512",
"theme_color" -> "#161512",
"description" -> "The (really) free, no-ads, open source chess server.",
"icons" -> List(32, 64, 128, 192, 256, 512, 1024).map { size =>
Json.obj(
"src" -> s"//${env.net.assetDomain.value}/assets/logo/lichess-favicon-$size.png",
"sizes" -> s"${size}x$size",
"type" -> "image/png"
)
},
"related_applications" -> Json.arr(
Json.obj(
"platform" -> "play",
"url" -> "https://play.google.com/store/apps/details?id=org.lichess.mobileapp"
),
Json.obj(
"platform" -> "itunes",
"url" -> "https://itunes.apple.com/us/app/lichess-free-online-chess/id968371784"
)
)
)
)
)
) as JSON withHeaders (CACHE_CONTROL -> "max-age=1209600")
val manifest = Action(manifestResponse)
}
}
def getFishnet =
Open { implicit ctx =>