Etag and Content-Type support in KV Storage

Is there a way to store metadata for an item in KV Storage when posting? Specifically it would be great if you could store the content-type of the object and a ETag, so that we can serve 304’s easily.

I guess we could prepend the tags in the beginning of the files or solve it some other creative way, but would prefer not to if possible.


1 Like

Afaik, the only way to store “metadata” is to add it to the KV key name and then use the prefix to retrieve them.


Be aware of the higher costs to listing:

So to use this with storage, you’d have to roll your own File upload mechanism using the API, located here:

1 Like

We should have a good solution for you here sometime in the near future!


That sounds promising! Do you have a rough timeline on when you think it will be available? Would be great if we could wait for the proper solution instead of implementing a hack around it.

1 Like

Thanks @thomas4! That’s a nicer solution than what I came up with :slight_smile:

1 Like

I can’t make promises, but it’s more like “a month or so” than “six months or so”.