Skip to content

roymax/play-cdn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages