Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Plugin that plays together with grails resources plugin but loads resources from a CDN like Amazon CloudFront
Groovy Gosu
branch: master
Failed to load latest commit information.
docs docs
grails-app removed jets3t dependency
scripts first commit
test/unit/grails/plugin/cdnresources added tests and bumped version number
web-app/WEB-INF renamed plugin to cdn-resources
CdnResourcesGrailsPlugin.groovy removed jets3t dependency
LICENSE.txt removed jets3t dependency removed jets3t dependency
grails-cdn-resources-grailsPlugins.iml tests for CdnMapper
plugin.xml removed jets3t dependency

NOTE: The functionality of this plugin has been merged into the main resources plugin under the baseUrl functionality. You don't need to use this plugin anymore and it will not be maintained.

Cdn-resources -- Content Delivery Network support for grails resources plugin

Flattr this


This plugin allows you to use a content delivery network ( like Amazon CloudFront ) to deliver resources served by the grails resources plugin. It is loaded after the zipped and cached resources plugins so that any modifications made by these plugins will also apply.


In your application directory, call

$ grails install-plugin cdn-resources

You would need to add the following parameters to your config.groovy file

$ grails.resources.cdn.enabled = true
$ grails.resources.cdn.url = ""


You can also define a separate CDN location per module ( for files being hosted by Google, for example ).

The syntax for this is

$ grails.resources.cdn.moduleUrls = [ 'google' : '', 'core' : '' ]

If you set up your Content Delivery Network correctly, all your resource files will be served from the CDN from now on.


Before you can use this plugin, you need to set up a content delivery network to dispatch your resources.

The following section describes how to do so on Amazon CloudFront. You would need an account for this, which you can sign up for at

1 Login to your Amazon AWS Console -

2 Click on Create Distribution

3 Select custom Origin and enter the URL of your site.

Set custom origin

4 If you wish to map the URL to a CNAME ( ie, point to instead of ), you can specify this in the next screen.

5 Review the details and click OK.

Review Details

6 You should now see your Cloudfront distribution.



You will see an url of the form This will be the value that you enter in the grails.resources.cdn.url value in Config.groovy.

$ grails.resources.cdn.url = ""
Something went wrong with that request. Please try again.