CDN will be native support in play 1.1
This module allows you to use CDN url or subdomain
Enable the CDN Support for the application
In the /conf/application.conf file, enable the CDN Support by adding this line:
# The CDN Module
module.cdn=${play.path}/module/cdn
and adding 2 line follow:
# The JavaScript Base URL and StyleSheet Base URL
script_path=http://localhost:9000/public/javascript
stylesheet_path=http://localhost:9000/public/stylesheet
# for stylesheet
<link rel="stylesheet" type="text/css" media="screen" href="@{'/public/stylesheets/main.css'}">
bc. # Replace to
#{cdn.stylesheet src:'default.css',media:'screen,print' /}
# for javascript
<script src="@{'/public/javascripts/jquery-1.4.2.min.js'}" type="text/javascript" charset="utf-8"></script>
bc. # Replace to
#{cdn.script 'path/to/jquery.js' /}
Enjoy It.