Cache JS, not homepage

This commit is contained in:
Thibault Duplessis 2013-01-06 14:05:39 +01:00
parent 06cf2e1120
commit 2d116a2a4f
2 changed files with 10 additions and 2 deletions

View file

@ -83,7 +83,8 @@ trait LilaController
protected def JsonIOk(map: IO[Map[String, Any]]) = JsonOk(map.unsafePerformIO)
protected def JsIOk(js: IO[String], headers: (String, String)*) = JsOk(js.unsafePerformIO)
protected def JsIOk(js: IO[String], headers: (String, String)*) =
JsOk(js.unsafePerformIO, headers: _*)
protected def JsOk(js: String, headers: (String, String)*) =
Ok(js) as JAVASCRIPT withHeaders (headers: _*)

View file

@ -24,7 +24,14 @@ object Lobby extends LilaController with Results {
private def openTours = env.tournament.repo.created
private def teamCache = env.team.cached
val home = Open { implicit ctx Async { renderHome(none, Ok) } }
val home = Open { implicit ctx
Async {
renderHome(none, Ok).map(_.withHeaders(
CACHE_CONTROL -> "no-cache",
PRAGMA -> "no-cache"
))
}
}
def handleNotFound(req: RequestHeader): Result = handleNotFound(reqToCtx(req))