Created
December 17, 2012 11:25
-
-
Save villemt/4317583 to your computer and use it in GitHub Desktop.
Play Framework 2.0, action caching, not in dev mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object ProductionCached { | |
def apply[A](key: String, duration: Int)(action: Action[A]): Action[A] = { | |
if (play.Play.isTest || play.Play.isDev) | |
action | |
else | |
Cached(_ => key, duration)(action) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment