Headless Optimizely
Describes using the Content Delivery API to build a headless Optimizely solution.
Optimizely headless solution
In a headless solution, the website presentation layer is decoupled from the back-end content management and ecommerce functionality. This is useful, for example, when pulling content data into other systems, making it accessible for display on any output device.
The Optimizely Content Delivery APIÂ is a flexible and unified API for content delivery across managed content types. It supports Optimizely Content Management System (CMS) content types, and Optimizely Customized Commerce content types like catalog nodes, products, variants, and pricing.
The Content Delivery API also supports rendering of forms built with Optimizely Forms, for example, in single-page application sites built with React or Vue.
For sample sites and source code, see the Content Delivery JS SDK repository repository on GitHub.
Cloudflare headless page rules
Cloudflare does not automatically cache .json results. Rules allow responses from endpoints in ContentDeliveryApi
(CD
) and ContentDeliveryApi.Search
(CD.Search
) to be cached for clients. The pattern covers endpoints in CD
. The pattern for those rules is narrowed down in scope so that they only cover endpoints in CD
and CD.Search
.
{domain}/api/episerver/*/content
– Intended to capture and cache response data fromCD
and the patterns cover mostly endpoints inCD
like content data, content’s children, and content’s ancestors, get list of contents.{domain}/api/episerver/*/site
– Intended to capture and cache response data from endpoints to return site data{domain}/api/episerver/*/search/content
– Intended to capture and cache response data from endpoints to search content data.
Clients may use accept-language when requesting content, so the page rule should also consider language.
Updated 6 months ago