Hey folks, We accidentally set the `cacheTtl` for a `KV.get()` to `300000s` (~3.5 days) instead of `

Hey folks,
We accidentally set the cacheTtl for a KV.get() to 300000s (~3.5 days) instead of 300s (5min). That resulted in caching the values and seeing stale data for longer than expected.
We went back and updated the cacheTtl to be 300 after a couple days when we realized there's an issue with stale data, but we are still seeing stale data regardless. The fix was merged more than 2h ago, and fetched some entries to reset the cacheTtl as the docs say here, but no luck.
Any idea how to fix this?

The effective cacheTtl of an already cached item can be reduced by getting it again with a lower cacheTtl. For example, if you did NAMESPACE.get(key, {cacheTtl: 86400}) but later realized that caching for 24 hours was too long, you could NAMESPACE.get(key, {cacheTtl: 300}) or even NAMESPACE.get(key) and it would check for newer data to respect the provided cacheTtl, which defaults to 60 seconds.
Cloudflare Docs
To get the value for a given key, call the get() method of the KV binding on any KV namespace you have bound to your Worker code:
Was this page helpful?