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
{{ message }}
Repository navigation
Cache GatekeeperVendor.describe() per User DO?
#828
UserDurableObject calls vendor.describe() on every bound vendor each time it lists or provisions
auto-provisioned apps (Promise.all over this.vendors), and again in the add-by-vendor path. Each
call is an RPC to another Worker. A vendor's description only changes on redeploy.
I have a ~20-line patch (user.ts only) that caches the promise per vendor in memory for 5 minutes:
TTL bounds how long a stale description lingers after a rolling deploy.
A rejected describe() is evicted, so failures are never cached and the next caller retries.
In-memory only, so it is dropped when the DO is evicted; nothing persisted.
Tradeoff: an admin-visible change in a vendor's description can lag by up to 5 minutes.
Is this worth having? If so, I'll open the PR, and I can add numbers on how many describe() RPCs a
page load costs
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
UserDurableObjectcallsvendor.describe()on every bound vendor each time it lists or provisionsauto-provisioned apps (
Promise.alloverthis.vendors), and again in the add-by-vendor path. Eachcall is an RPC to another Worker. A vendor's description only changes on redeploy.
I have a ~20-line patch (user.ts only) that caches the promise per vendor in memory for 5 minutes:
describe()is evicted, so failures are never cached and the next caller retries.Tradeoff: an admin-visible change in a vendor's description can lag by up to 5 minutes.
Is this worth having? If so, I'll open the PR, and I can add numbers on how many describe() RPCs a
page load costs
All reactions