Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
diff --git a/framework/src/play/src/main/scala/play/api/controllers/Assets.scala b/framework/src/play/src/main/scala/play/api/controllers/Assets.scala
index 18ef4cb..9649c5a 100644
--- a/framework/src/play/src/main/scala/play/api/controllers/Assets.scala
+++ b/framework/src/play/src/main/scala/play/api/controllers/Assets.scala
@@ -64,6 +64,7 @@ class AssetsBuilder extends Controller {
* @param file the file part extracted from the URL
*/
def at(path: String, file: String): Action[AnyContent] = Action { request =>
+ val now = System.currentTimeMillis()
// -- LastModified handling
def parseDate(date: String): Option[java.util.Date] = try {
@@ -114,7 +115,7 @@ class AssetsBuilder extends Controller {
cachedResponse
}
- resource.map {
+ val r = resource.map {
case (url, _) if new File(url.getFile).isDirectory => NotFound
@@ -156,6 +157,9 @@ class AssetsBuilder extends Controller {
}.getOrElse(NotFound)
+ println(s"Loading resource $path/$file took ${System.currentTimeMillis() - now} ms")
+ r
+
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.