Simplified Storage Cleanup for Durable Objects
The deleteAll() method for Cloudflare Durable Objects now automatically deletes alarms along with user-stored data, streamlining cleanup operations for developers.
What Changed
Previously, deleteAll() only removed user data from a Durable Object's storage. Since alarm metadata is stored within the object's storage, developers had to make two separate API calls to completely clear an object:
// Old approach - two calls required
await this.ctx.storage.deleteAlarm();
await this.ctx.storage.deleteAll();
With this update, a single call now handles everything:
// New approach - one call clears all
await this.ctx.storage.deleteAll();
Compatibility and Coverage
This change applies to all Workers with a compatibility date of 2026-02-24 or later and works across both storage backends:
- KV-backed Durable Objects
- SQLite-backed Durable Objects
Impact
This reduces API overhead for cleanup operations and simplifies code for developers managing Durable Object lifecycles. It's particularly useful for batch cleanup, object expiration, and garbage collection patterns.