For me - the most powerful and obvious use of durable objects is as a caching layer - in front of the API of our SaaS.
For a given incoming URL pattern that’s a GET on our API, my idea is to fetch the data off a durable object, avoiding a call to our origin.
The fact that consistency is guaranteed is the real reason this works - since an object with lots of writes would not have worked very well with KV store.
Our API (upon write) would push the latest object into the durable object. This makes any GET much faster since the cache serves it.
There’s two things I would need, for the Cloudflare team:
- I need a larger storage limit in the 100kb - 3Mb type of range. On a brief look at limits, per-object limits were quite low.
- Just like KV store has auto-expiration of keys/values - I need the same in durable objects e.g. expire this object (so no billing would accrue and it simply wouldn’t exist) for a given lifetime e.g. 3 days. In addition, this lifetime should be resettable i.e. on every fetch, reset the countdown to expire to 3 days. This makes stale cache/objects go away automatically.
Is this on the roadmap?