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
Copy file name to clipboardExpand all lines: src/content/docs/durable-objects/examples/durable-object-ttl.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ A common feature request for Durable Objects is a Time To Live (TTL) for Durable
14
14
15
15
:::caution[Not available in local development]
16
16
17
-
The TTL is extended upon every new fetch request to the Durable Object. It might be tempting to instead extend the TTL in the constructor of the Durable Object. This is not advised because the Durable Object's constructor will be called before invoking the alarm handler if the alarm wakes the Durable Object up from hibernation. This approach will naively result in the constructor continually extending the TTL without running the alarm handler.
17
+
The TTL is extended upon every new fetch request to the Durable Object. Cloudflare does not advise extending the TTL in the constructor of the Durable Object. This is because the Durable Object's constructor will be called before invoking the [alarm handler](/durable-objects/api/alarms/#handler-methods) if the alarm wakes the Durable Object from hibernation. This approach will naively result in the constructor continually extending the TTL without running the alarm handler.
0 commit comments