Trace when body is consumed
I have a middleware that's basically
cache is https://www.npmjs.com/package/node-cache with useClones=false
This works great locally but when deployed to production it randomly throws
TypeError: Response.clone: Body has already been consumed.
on the first clone. Does anyone know if there's an easy way to tell what else is reading the body? This is the only thing using the cache instance so I don't understand how it's even possible.
Server and dev both have node 22.8.01 Reply
really weird, there's 10+ seconds between when the response is created and when it is consumed
I can only reproduce it in dev if I use the etag middleware too, and even then it doesn't happen consistently
it can't be node-cache cleaning up because cache.get still returns