vans163
09/26/2021, 8:44 AMvans163
09/26/2021, 8:44 AMvans163
09/26/2021, 1:26 PMvans163
09/26/2021, 1:53 PMvans163
09/26/2021, 1:55 PMvans163
09/26/2021, 2:15 PMWalshy | Pages
09/26/2021, 2:16 PMWalshy | Pages
09/26/2021, 2:16 PMronan(wighawag)
09/26/2021, 8:32 PMjohn.spurlock
09/26/2021, 9:46 PMkey
, and entries
that is, values
correspond to the sorted keys) And when you pass reverse: true
, they iterate in reverse orderronan(wighawag)
09/26/2021, 9:47 PMjohn.spurlock
09/26/2021, 9:51 PMronan(wighawag)
09/26/2021, 9:56 PMmoomoo
09/27/2021, 12:12 PMuser/${id}
)))
So I was thinking of storing the names in a central strings KV paired with ids. But KV API only allows you to get one key at a time it does not let you do env.NAMES.get([ ...ids ]). So this would still need 100 requests too (and KV requests are more expensive).
I could store the name lookup in storage in a 'name' Durable Object. Look ups would be cheap as I could do a single this.state.storage.get([...ids]) and return 128 names at once. But because there can only be one instance of a Durable Object it creates a bottle neck which all users need to be squeezed through.
I am not wanting to duplicate the names as cache invalidation is hard.
What is the best way of handling these kind of list screens where you want to grab and display a name for all ids in an array?HardAtWork
09/27/2021, 4:07 PMalbert
09/27/2021, 4:13 PMHardAtWork
09/27/2021, 4:14 PMbrett
09/27/2021, 4:21 PMHardAtWork
09/27/2021, 4:21 PMbrett
09/27/2021, 4:22 PMbrett
09/27/2021, 4:23 PMHardAtWork
09/27/2021, 4:28 PMbrett
09/27/2021, 4:41 PMbrett
09/27/2021, 4:42 PMHardAtWork
09/27/2021, 4:42 PMbrett
09/27/2021, 4:42 PMHardAtWork
09/27/2021, 4:45 PMbrett
09/27/2021, 4:54 PMTitan
09/27/2021, 6:25 PMlux
09/27/2021, 6:33 PM