By Autocleaning, I mean like scheduling an alarm that deletes everything stored, if it hasn't been r
By Autocleaning, I mean like scheduling an alarm that deletes everything stored, if it hasn't been renewed before then.
As an example, in a few of my apps, I use a DO as a more secure cookie. I.e., while the client just sees an opaque value stored, I can ask the DO corresponding to that opaque value, and it returns a user id, their expected user agent/location, etc.. However, because cookies themselves don't persist forever, I want to ensure that the DOs don't stick around forever either, as that would cost me money for no benefit. Thus, I set an alarm for the time that the cookie would expire, and then on every call to the DO, I reset the alarm. If the alarm fires, it deletes all of its storage, so that I'm no longer billed for it
As an example, in a few of my apps, I use a DO as a more secure cookie. I.e., while the client just sees an opaque value stored, I can ask the DO corresponding to that opaque value, and it returns a user id, their expected user agent/location, etc.. However, because cookies themselves don't persist forever, I want to ensure that the DOs don't stick around forever either, as that would cost me money for no benefit. Thus, I set an alarm for the time that the cookie would expire, and then on every call to the DO, I reset the alarm. If the alarm fires, it deletes all of its storage, so that I'm no longer billed for it

