Cache diverges across nodes #673
Replies: 3 comments 1 reply
-
After troubleshooting for some time, I've concluded that the issue in prod is that something is failing with the CacheHandler (debugging shows The docs could also be clearer about the fact that the Most importantly -- is it possible to configure things so that, if the custom CacheHandler fails for any reason, it is a terminal error? In no case do I want the in-memory cache or any other fallback, because that just means the application is broken in generally subtle ways. I would expect some detailed logging on what's wrong, followed by termination of the app. Thanks for any pointers. |
Beta Was this translation helpful? Give feedback.
-
Okay, various mysteries have been solved now, just following up here in case it helps anyone. The confusing behavior turned out to be due to the In short -- both the |
Beta Was this translation helpful? Give feedback.
-
Hey @markedwards! I'm sorry for not paying attention to this earlier. Thank you for providing valuable information about the files: I want to highlight that you can debug using this environmental variable $ npm run start
✓ Starting...
✓ Ready in 36ms
using custom cache handler @neshca/cache-handler is not configured yet
Connecting Redis client...
Redis client connected.
get from "redis-stack" /app/with-params/dynamic-true/200 false
The logs will appear like this if there is no cache handler configuration:
Refer to the Troubleshooting docs section for more info. |
Beta Was this translation helpful? Give feedback.
-
I have a deployment in AWS which has two server nodes deployed via ECS, both connecting to a single Redis service. They both use the same
keyPrefix
, based on the Git commit hash. All caching is via the nextunstable_cache
, using tags.If a cached item is deleted in the DB and
revalidateTag
is called, I'm seeing a cache divergence. One refresh will show the deleted value, the next it disappears, etc.I'm using a standard
redis-strings
config following the docs. Just want to confirm that this approach should work as expected out of the box?Beta Was this translation helpful? Give feedback.
All reactions