nuxt-hub / core

Build full-stack applications with Nuxt on CloudFlare, with zero configuration.
https://hub.nuxt.com
Apache License 2.0
916 stars 51 forks source link

[Admin Console] "Too many API requests by single worker invocation." when opening large cache #213

Open manniL opened 1 month ago

manniL commented 1 month ago

Describe the bug When opening the _ group with > 1k cached entries, no entries are shown because the console does too many API request in a single worker call

Steps to reproduce Steps to reproduce the behavior:

  1. Have a cache with > 1k entries (I suppose)
  2. Click on Cache in the sidebare
  3. Try to open the group
  4. See No items
image image image

Expected behavior

Working overview

atinux commented 1 month ago

Damn, what do you do with so many cache entries 😂

The issue comes from https://github.com/nuxt-hub/core/blob/91a1d97436bd1f311c0baeff0e2d40f6b85f0a07/src/runtime/cache/server/api/_hub/cache/%5B...key%5D.get.ts#L29-L50

I think we need to start implementing a pagination, but quite tricky with KV.

manniL commented 1 month ago

Damn, what do you do with so many cache entries 😂

The issue comes from

https://github.com/nuxt-hub/core/blob/91a1d97436bd1f311c0baeff0e2d40f6b85f0a07/src/runtime/cache/server/api/_hub/cache/%5B...key%5D.get.ts#L29-L50

I think we need to start implementing a pagination, but quite tricky with KV.

I have lots of static content from third party APIs which can stay in the cache 👀 But giving easier cache names helped already :P

Yeah, that's a big issue, pagination is a bit meh, though the CF API should allow it at least somehow.