Ask a Question
Back to All

Mixing Deadbolt with Play cached Actions


Any advice on how best to mix the two in a controller function? e.g.

def aCacheableResponse(id: String) = 
  deadbolt.SubjectPresent()() { implicit request =>
    cached((_: RequestHeader) => s"something.$id", 1.hour) {
      Action.async {
        //do some stuff here, get a future result

doesnt work, but is there something similar to this I can try?