13 Compile Sites

Site compilation is the process of creating a static HTML file for each page in a site. The resulting HTML page will behave exactly the same as the dynamic page that would have been rendered by the JavaScript controller file in the web browser, but will load faster.

Site compilation in Oracle Content Management is an optional process that can be called after the site is published to generate the static HTML pages for the site. Once the site compilation is completed, the generated HTML files are uploaded to a ‘static’ folder under the site. From there they are published to the site runtime. Subsequent requests to a site URL will return these compiled HTML files.

Through site compilation, you can ideally remove all JavaScript from the page that is not required to support page functionality on the a client-side. This includes removing any Oracle Content Management JavaScript code, so that only HTML and CSS are rendered in the browser, which gives the page the fastest possible runtime performance.

Oracle Content Management has a compilation service built-in to easily allow you to compile a site without any additional configuration. Or you may manually set up a compilation service for testing purposes to validate site compilation, or to use custom libraries.

Static Properties tab

Site compilation is a Node.js application that executes in the background after the site has been published. It generates a server-side rendered page by combining the page layout with the page-ID.json metadata to generate the HTML file that will be returned, instead of the controller.html file with JavaScript. To determine how a site page is being rendered, you can view the page source in your web browser. If the page is delivered as compiled, you’ll see the page HTML code. If it’s delivered as controller page, you’ll see the controller.html file instead.

See Compile and Publish Sites with Oracle Content Management for detailed information about the compile process, site compile API, and various compiler and delivery options.