Search code examples
playframeworkplayframework-2.3webjars

Webjars-play 2.3.x - Why do we need WebJarAssets.locate and routes.WebJarAssets.at when the path assets/lib/css/filename works


I am bit confused about the Webjars usage in play 2.3.x, I am able to include and webjar and access a js or css file inside it using /assets/lib/css/name in play 2.3.x, however the Webjars site continues to describe about adding a versioned assets configuration in routes file. I am not getting why is this required? Could you please help

Webjars Documentation link: http://www.webjars.org/documentation


Solution

  • Versioned assets allow you to add some optimizations to your static asset loading - e.g. 304 Not Modified and far-future expires. For more info check out my Optimizing Static Asset Loading with Play Framework blog.