How to ask Play to automatically insert the file\'s ETag as a comment near the top of the file without using third party plugins?
E.g., for a HTML resource, insert
In conf/routes
add the following:
GET /resources/*file controllers.Resources.at(file)
In app/controllers/Resources
controller:
package controllers
import play.api.mvc._
object Resources extends Controller {
def at(path: String): Action = {
// calculate ETag
val etag = ETag(path)
// stream file with ETag inserted
Ok(... <!-- ETag: etag --> ...)
}
}