Support for CDN has been added to Odoo in master
branch.
Just tested with KeyCDN and the setup was straightforward.
##Step 1: Create a pull zone in the KeyCDN dashboard
While creating the zone, enable the CORS option in the advanced features
submenu. (more on that later)
Once done, you'll have to wait a bit while KeyCDN is crawling your website.
Note that an url has been provided for your Zone, in this test case, the url is http://pulltest-b49.kxcdn.com
##Step 2: Configure the odoo instance with your zone
In the odoo backend, go to the Website Settings
menu, then activate the CDN support and copy/paste your zone url in the CDN Base URL
field.
Now your website is using the cdn for the resources matching the CDN filters
regular expressions.
Check the html of your website to see if the CDN integration is properly working.
##Why should I activate CORS?
A security restriction in Firefox and Chrome (at time of writing) prevents a remotely referenced CSS file to fetch resources on the external server. This is the case for the font-awesome lib used in odoo.
Without CORS enabled on the remote CDN, the font file won't be loaded and here's what you will see instead of font-awesome icons:
A security error message will appear in the console:
In this case, just activate the CORS option in the CDN:
and the CSS resources will be loaded:
I add the cdn as this tutorial said, but does not work.:(