I\'m using Play 2.4.0 and I\'ve been trying to follow the tutorial from the main page: https://playframework.com/ which is for Play 2.3 and after solving a couple of issues rega
Alright, to sum up the solution: Play lets you serve your assets in two different ways. The old fashioned and the new fingerprinted method introduced with sbt-web. In either case make sure you use right call in your view files:
This is the recommended way to serve assets in play. Fingerprinted assets make use of an aggressive caching strategy. You can read more about this topic here: https://playframework.com/documentation/2.4.x/Assets
routes config:
GET /assets/*file controllers.Assets.versioned(path="/public", file: Asset)
Make sure the type of file
is indicated as Asset
call in views:
@routes.Assets.versioned("an_asset")
This is basically the method used before the introduction of sbt-web.
routes config:
GET /assets/*file controllers.Assets.at(path="/public", file)
call in views:
@routes.Assets.at("an_asset")