esi-cf-workers
v1.0.0
Published
Edge Side Includes (ESI) for Cloudflare Workers
Downloads
12
Readme
cf-esi-include
Edge Side Includes (ESI) for Cloudflare Workers
Usage
Installation:
yarn add cf-esi-include
Usage in Cloudflare Pages
Create a middleware, at functions/_middleware.js
with the follwing content:
import { withESI } from "esi-cf-workers"
export async function onRequest(context) {
const res = await context.next();
return withESI(res);
}