Home > play-cdn

play-cdn

Play-cdn is a project mainly written in Python, it's free.

Play Framework CDN Support Module

CDN will be native support in play 1.1

h1. Play CDN Support Module

This module allows you to use CDN url or subdomain

h2. Enable the CDN Support for the application In the /conf/application.conf file, enable the CDN Support by adding this line:

bc. # The CDN Module module.cdn=${play.path}/module/cdn

p. and adding 2 line follow:

bc. # The JavaScript Base URL and StyleSheet Base URL script_path=http://localhost:9000/public/javascript stylesheet_path=http://localhost:9000/public/stylesheet

h2. Example In The **/views/main.html

bc. # for stylesheet

bc. # Replace to

{cdn.stylesheet src:'default.css',media:'screen,print' /}

bc. # for javascript

bc. # Replace to

{cdn.script 'path/to/jquery.js' /}

Enjoy It.