Do we get billed for auto-expired keys on Workers KV?

On the docs it says:

The core behavior of an expiring key is that once its expiration time has been reached, attempts to read it will behave as if the key does not exist. Attempting to get the key’s value will return a promise that resolves to null in a Worker or a 404 HTTP response via the API, and listing keys using the API will omit any expired keys from the response.

Since an expired key is effectively useless, is it considered “deleted” as far as billing is concerned?

We are excited about a caching use case for Workers KV but we will not start doing it if we don’t have a guarantee that auto-expiring keys are actually deleted, to prevent a constant/never-ending build-up of keys, and therefore - costs.

Thanks - Amit from Tallyfy - We :heart_eyes: Cloudflare

expiring a key is free, in the past this was in the docs “Usage of all other features of Worker KV do not affect pricing.”

1 Like

Thanks! But does the key actually delete forever, never to be billed again?

Just confused on expiry vs. deletion

Yes, when a key expires it gets “delete” (I don’t know the exact eviction mechanism, may be it is not immediately evicted, but it becomes inaccessible). Here is a Twitter Dev Team blog post on this.

That delete is free of charge, and storage stops being billed.

This should really be documented in pricing @harris

I agree. I’ve filed https://github.com/cloudflare/workers-docs/issues/910 to get it added.

1 Like