You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am lucky to get early access to Deno.openKv() in Deno Deploy. I was just playing with it. I made a very simple function which redirects users to a url.
I want to keep the key for 1 day. Then the key will expire. But Now I have to add timestamp in each key. And I have to loop through all keys then delete keys that are older than 1 day.
Can openKv perform auto deletion of keys based on time or after a certain time?
The text was updated successfully, but these errors were encountered:
I've been interested also in the possibility to set an "experitation time" for data stored. Since clearing out expired data is a background job, it does not feel like the right fit to clear out data when performing other requests.
If there were some way to run background tasks, I would be fine with not having an explicit API for how long data should last before auto-deletion, though it would still be a neat feature to support it in KV directly.
I was planning to migrate my visitor-badge service to deno deploy and kv, but I did not find similar data expiring strategy, so I just setup a deno deployment and make it works for me only, like below badge:
I am lucky to get early access to Deno.openKv() in Deno Deploy. I was just playing with it. I made a very simple function which redirects users to a url.
How it works/How to use it:
Deploy url is: https://307.deno.dev
If a user want to create a redirect url then he needs to add desired url in the path of the url.
Example 1: https://307.deno.dev/{target_url}
Example 2: https://307.deno.dev/https://example.com
User will get a url in response. If any user opens that url then it will redirect to targeted url.
This is my deploy code:
I want to keep the key for 1 day. Then the key will expire. But Now I have to add timestamp in each key. And I have to loop through all keys then delete keys that are older than 1 day.
Can openKv perform auto deletion of keys based on time or after a certain time?
The text was updated successfully, but these errors were encountered: