Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blob etag is undefined in edge function but changes each time the store is output as a list #6902

Open
Shotster opened this issue Oct 28, 2024 · 0 comments
Labels
type: bug code to address defects in shipped code

Comments

@Shotster
Copy link

Shotster commented Oct 28, 2024

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
@Shotster Shotster added the type: bug code to address defects in shipped code label Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

1 participant