documentation/content/administration/deployment/cdn.rst
Antoine Vandevenne (anv) e3fee2cf46 [REF][MOV] documentation apocalypse
Prior to this commit, the Odoo documentation was mainly split between
two repositories: odoo/odoo/doc and odoo/documentation-user. Some bits
of documentation were also hosted elsewhere (e.g., wiki, upgrade, ...).
This was causing several problems among which:
  - The theme, config, Makefile, and similar technical resources had to
    be duplicated. This resulted in inconsistent layout, features, and
    build environments from one documentation to another.
  - Some pages did not fit either documentation as they were relevant
    for both users and developers. Some were relevant to neither of the
    two (e.g., DB management).
  - Cross-doc references had to be absolute links and they broke often.
  - Merging large image files in the developer documentation would bloat
    the odoo/odoo repository. Some contributions had to be lightened to
    avoid merging too many images (e.g., Odoo development tutorials).
  - Long-time contributors to the user documentation were chilly about
    going through the merging process of the developer documentation
    because of the runbot, mergebot, `odoo-dev` repository, etc.
  - Some contributors would look for the developer documentation in the
    `odoo/documentation-user` repository.
  - Community issues about the user documentation were submitted on the
    `odoo/odoo` repository and vice-versa.

Merging all documentations in one repository will allow us to have one
place, one theme, one work process, and one set of tools (build
environment, ...) for all of the Odoo docs.

As this is a good opportunity to revamp the layout of the documentation,
a brand new theme replaces the old one. It features a new way to
navigate the documentation, centered on the idea of always letting the
reader know what is the context (enclosing section, child pages, page
structure ...) of the page they are reading. The previous theme would
quickly confuse readers as they navigated the documentation and followed
cross-application links.

The chance is also taken to get rid of all the technical dangling parts,
performance issues, and left-overs. Except for some page-specific JS
scripts, the Odoo theme Sphinx extension is re-written from scratch
based on the latest Sphinx release to benefit from the improvements and
ease future contributions.

task-2351938
task-2352371
task-2205684
task-2352544

Closes #945
2021-05-04 15:44:00 +02:00

82 lines
2.4 KiB
ReStructuredText

========================================
Deploying with Content Delivery Networks
========================================
.. _reference/cdn/keycdn:
Deploying with KeyCDN_
======================
.. sectionauthor:: Fabien Meghazi
This document will guide you through the setup of a KeyCDN_ account with your
Odoo powered website.
Step 1: Create a pull zone in the KeyCDN dashboard
--------------------------------------------------
.. image:: cdn/keycdn_create_a_pull_zone.png
:class: img-fluid
When creating the zone, enable the CORS option in the
:guilabel:`advanced features` submenu. (more on that later)
.. image:: cdn/keycdn_enable_CORS.png
:class: img-fluid
Once done, you'll have to wait a bit while KeyCDN_ is crawling your website.
.. image:: cdn/keycdn_progressbar.png
:class: img-fluid
.. note:: a new URL has been generated for your Zone, in this case it is
``http://pulltest-b49.kxcdn.com``
Step 2: Configure the odoo instance with your zone
--------------------------------------------------
In the Odoo back end, go to the :guilabel:`Website Settings`: menu, then
activate the CDN support and copy/paste your zone URL in the
:guilabel:`CDN Base URL` field. This field is only visible and configurable if
you have developer mode activated.
.. image:: cdn/odoo_cdn_base_url.png
:class: img-fluid
Now your website is using the CDN for the resources matching the
:guilabel:`CDN filters` regular expressions.
You can have a look to the HTML of your website in order to check if the CDN
integration is properly working.
.. image:: cdn/odoo_check_your_html.png
:class: img-fluid
Why should I activate CORS?
---------------------------
A security restriction in some browsers (Firefox and Chrome at time of writing)
prevents a remotely linked CSS file to fetch relative resources on this same
external server.
If you don't activate the CORS option in the CDN zone, the more obvious
resulting problem on a default Odoo website will be the lack of font-awesome
icons because the font file declared in the font-awesome CSS won't be loaded on
the remote server.
Here's what you would see on your homepage in such a case:
.. image:: cdn/odoo_font_file_not_loaded.png
:class: img-fluid
A security error message will also appear in the browser's console:
.. image:: cdn/odoo_security_message.png
:class: img-fluid
Enabling the CORS option in the CDN fixes this issue.
.. _KeyCDN: https://www.keycdn.com