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
I was trying to implement a two-level cache on one of our systems. Our goal is to have a long-lived global Redis cache shared between a couple of instances of our Express app, and a smaller short-lived in-memory cache to relieve the load on Redis.
When we access any endpoint after both middlewares, it spins in an endless loop, apparently concatenating the outputs. This happens regardless we are using Redis or in-memory caches.
The Node process then crashes with the following error:
I know this is an edge case that apicache might not cover, and for now we can handle a little more load on the Redis servers. We wanted to check if we are missing something here, or if we can work around this behaviour somehow.
The text was updated successfully, but these errors were encountered:
pcostesi
changed the title
Using two instances as middlewares cause a loop on response
Using two instances as middlewares causes a loop on response
Jun 14, 2020
I think this might be related to #200. However, we want both caches to work at the same time, so if the in-memory cache has a miss then the Redis cache has a chance to handle the response too.
I was trying to implement a two-level cache on one of our systems. Our goal is to have a long-lived global Redis cache shared between a couple of instances of our Express app, and a smaller short-lived in-memory cache to relieve the load on Redis.
When we access any endpoint after both middlewares, it spins in an endless loop, apparently concatenating the outputs. This happens regardless we are using Redis or in-memory caches.
The Node process then crashes with the following error:
The log output is quite massive (nearly 2.2G). From what I could find, I think the following might help:
This is a minimal reproduction of the setup:
We tested these scenarios with the following:
curl localhost:3000/alive -v
curl localhost:3000/foo -v
I know this is an edge case that apicache might not cover, and for now we can handle a little more load on the Redis servers. We wanted to check if we are missing something here, or if we can work around this behaviour somehow.
The text was updated successfully, but these errors were encountered: