Skip to content
roymaxPublic

About

Play Framework CDN Support Module

Resources

Stars

4 stars

Watchers

1 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

Repository files navigation

CDN will be native support in play 1.1

Play CDN Support Module

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

Example
In The **/views/main.html

# 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.

About

Play Framework CDN Support Module

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages