Blob etag is undefined in edge function but changes each time the store is output as a list
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.9k
- Forks
- 474
- Avg merge
- 23h 30m
- Merged PRs (30d)
- 53
Description
Describe the bug
I’ve been experimenting with blobs as a programmable cache as described in this Netlify blog post.
If I inspect the stored blob's etag (by outputting it in a header for instance), the value is always undefined. If, however, I list the contents of the store (which contains just the single blob), then the etag for the same stored blob changes with each request.
I'd expect the etag to be always present and unchanging until a new version of the resource is stored. It works as expected when deployed.
Steps to reproduce
Here’s the code executed with each request after the blob has already been stored…
const myCache = getStore('my-cache')
const cacheInfo = await myCache.list()
console.log( cacheInfo.blobs )
And here’s the output of my edge function named “transform” after 3 consecutive requests (without modifying the store or updating the blob)…
[transform] [ { etag: "19805199838756904", key: "my-key" } ]
[transform] [ { etag: "7045868894520977", key: "my-key" } ]
[transform] [ { etag: "31968353280310935", key: "my-key" } ]
The etag is different with each request. It works as expected when deployed to Netlify.
Configuration
No response
Environment
System:
OS: macOS 15.0.1
CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Memory: 5.92 GB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.2.0 - ~/.nvm/versions/node/v22.2.0/bin/node
Yarn: 1.3.2 - /usr/local/bin/yarn
npm: 10.8.2 - ~/.nvm/versions/node/v22.2.0/bin/npm
npmGlobalPackages:
netlify-cli: 17.37.1
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 the edge function named “transform” and reproduce the issue using getStore('my-cache').list() after storing a single blob. Trace the local blob list and etag handling, then verify that the etag is defined and remains unchanged across requests without modifying the blob, matching deployed behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100