denoland / deploy_feedback

For reporting issues with Deno Deploy
https://deno.com/deploy
74 stars 5 forks source link

[KV Feedback]: Check for keys existence without values #560

Open kewp opened 11 months ago

kewp commented 11 months ago

🔍

Type of feedback

Feature request

Description

I'm trying to keep a cache fresh without using up my KV reads. Right now whenever I use get or list I get the value as well which uses up my read quota. Would be great if I could just see if the key(s) are there.

Steps to reproduce (if applicable)

No response

Expected behavior (if applicable)

No response

Possible solution (if applicable)

No response

Additional context

No response

kewp commented 11 months ago

I've thought of a solution to this issue in the interim, for anyone coming here - hashing. What I can do is hash the contents, the value, of the kv store, and then I can just check the hash if the contents have changed (i.e. save the hash in another key, so each value in kv is paired with a hash). Before I was just letting the key expire, or pull down the value and compare, but pulling down uses the read limit ...