https://github.com/netlify/esi-edge-function
https://github.com/netlify/esi-edge-function
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/netlify/esi-edge-function
- Owner: netlify
- Created: 2023-08-20T18:30:53.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-05T15:02:07.000Z (about 1 year ago)
- Last Synced: 2025-02-25T13:15:43.868Z (4 months ago)
- Language: TypeScript
- Size: 5.86 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ESI Edge Function
This is a simple implementation of the basic tag, with an edge function.
Let's you use includes from a HTML file:
```
Testing ESI Includes
Testing ESI Includes
Testing ESI Includes
```
Currently requires the includes to live under the `/includes/` path prefix to avoid running the edge function both for the main HTML and each include.
The ESI stiching happens behind Netlify's edge cache, so the resulting document is cached after being stiched together.
To change this behavior (in case your includes are dynamic and need a cache lift cycle that's independent from the main HTML) remove the `cache: "manual"` setting from the `config` exported from `netlify/edge-functions/esi.ts`.