adapter-netlify edge function caching support
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 20.8k
- Forks
- 2.3k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 156
Description
Describe the problem
One feature of Netlify edge functions is the ability to cache responses, described here: https://docs.netlify.com/edge-functions/optional-configuration/#response-caching
This requires a small change to the manifest to indicate manual caching control:
Opt in to caching
You can set the cache property to manual inline in the function code, or in netlify.toml.
For inline configuration, use the config object in your edge function file.
import type { Config } from "https://edge.netlify.com"
export default async () => new Response("Hello, world!")
export const config: Config = {
cache: "manual",
path: "/hello"
}
Describe the proposed solution
From what I understand, if the adapter allowed some level of configurability of the manifest output it would be possible to enable caching here:
Alternatives considered
No response
Importance
would make my life easier
Additional Information
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with packages/adapter-netlify/index.js around line 116 and compare its manifest output with Netlify's response-caching documentation. The issue is addressed when the adapter's generated manifest can express the requested caching configuration and remains compatible with the documented Netlify edge-function setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- build-system, cloud
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100