Skip to content

This demos how you can modify the Asset controller to use a CDN, Fingerprinting, and other modifications to the basic assets pipeline.

License

Notifications You must be signed in to change notification settings

myyk/play-assets-improvements

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

First, I want to thank James Ward for this code which I largely used for this module. Specifically, this implementation is inspired by this blog: http://www.jamesward.com/2012/08/08/edge-caching-with-play2-heroku-cloudfront

With this 'module' you can get CDNs working easy.

  1. Add the dependency on this module.

  2. Add a value to your conf/application.conf file that points to your cdn.

cdn.contenturl="XXXXXXXXXXXXXX.cloudfront.net

By default the cdn assets will use HTTPS. If you don't want to use HTTPS, add this setting cdn.secure=false.

  1. Replace your Assets route in your conf/routes file like this.

If you had:

GET     /assets/*file               controllers.Assets.at(path="/public", file)

You now need

GET     /assets/*file               controllers.MyAssets.at(path=controllers.MyAssets.defaultPath, file)
  1. Replace all "routes.Assets.at" with "RemoteAssets.at" in your project. (note, you no longer need the "routes." because you are no longer using the reverse router.)

This content is released under the (Link Goes Here) MIT License.

About

This demos how you can modify the Asset controller to use a CDN, Fingerprinting, and other modifications to the basic assets pipeline.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages