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:
Hi i have a question:
I tried the CDN support and found one error or an not so good workaround.
Then I have an CDN active it works like a charm, but then i when use the website builder and save my changes the CDN links are hard copied in the views. So i have to manually change them back if i do not want to use this CDN anymore. is there a way or a commit you can show me how i may automatically set the CDN deactivate then i use edit in the front-end ?