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
The asset will download and cache correctly, without any error.
What do you see instead?
For assets smaller than ~130MB, it does download and cache correctly.
For assets bigger than ~130MB, it downloads until almost the end, and then errors (probably while trying to cache):
TypeError: ReadableStream.tee() buffer limit exceeded. This error usually occurs when a Request or Response with a large body is cloned, then only one of the clones is read, forcing the Workers runtime to buffer the entire body in memory. To fix this issue, remove unnecessary calls to Request/Response.clone() and ReadableStream.tee(), and always read clones/tees in parallel.
I think it should still be possible to cache assets bigger than 128MB though. as the cache limit is 512MB. But this probably requires changes in the current cache middleware.
The text was updated successfully, but these errors were encountered:
I think it should still be possible to cache assets bigger than 128MB though. as the cache limit is 512MB. But this probably requires changes in the current cache middleware.
I've never investigated the details, but my understanding is that Cache Middleware uses the Cache API in the Workers runtime. So, the limit is 128MB. Cache Middleware can't support more than 128MB.
What version of Hono are you using?
4.6.8
What runtime/platform is your app running on?
Cloudflare Workers
What steps can reproduce the bug?
You can use the below code to reproduce
What is the expected behavior?
The asset will download and cache correctly, without any error.
What do you see instead?
For assets smaller than ~130MB, it does download and cache correctly.
For assets bigger than ~130MB, it downloads until almost the end, and then errors (probably while trying to cache):
Additional information
I think the 130MB is related to the Cloudflare Workers memory limit, which is 128MB.
I think it should still be possible to cache assets bigger than 128MB though. as the cache limit is 512MB. But this probably requires changes in the current cache middleware.
The text was updated successfully, but these errors were encountered: