---
title: Build a headless solution with Content Delivery API
slug: dxp/docs/headless-optimizely
docTags: 
createdAt: 2026-07-30T20:33:07.587Z
---

## 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](docId:8J9LUIz7eXbqvAd-I62ve) is a flexible and unified API for content delivery across managed content types. It supports Optimizely Content Management System (CMS) content types, and Optimizely Commerce Connect 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](https://github.com/episerver/content-delivery-js-sdk) 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 from `CD` and the patterns cover mostly endpoints  in `CD` 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.
